mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
b9115623b2
- Ensure stack field_get/field_set has consistent metaprogramming for needing a pushed table, and at what offset - Avoid duplicate logic in table_core for the same logic by deferring to detail helper - Fixes #1095
20 lines
395 B
C++
20 lines
395 B
C++
#include <sol/sol.hpp>
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
unsigned int regression_1095() {
|
|
const std::string magic_value = "test_value";
|
|
|
|
sol::state lua;
|
|
lua[magic_value] = magic_value;
|
|
|
|
if (lua.globals().get<std::string>(magic_value) != magic_value) {
|
|
return 1;
|
|
}
|
|
if (lua.globals().raw_get<std::string>(magic_value) != magic_value) {
|
|
return 2;
|
|
}
|
|
return 0;
|
|
}
|