Comments (2)
Maybe sol::table::pointer does this?
from sol2.
Not 100% sure, but fairly sure there is no unique value you can get from the lua API.
You would need to compare the values using lua equality operation to determine if two tables are equal (lua_rawequal). You can then generate a running number yourself to keep track of the references.
Another way is to instead keep track of the data in lua. With a lua table you can store the table itself as the key and then later when you want to check if a table was already seen, you just look it from the table (example).
A quick and dirty alternative might be to use tostring() on the table. This will return a string similar to table: 0x1b85730
where the value is the address of the table I recon. However, a table can override the tostring operation with a metafield __tostring
.
from sol2.
Related Issues (20)
- why is get_type return userdata?
- Build with emscripten? HOT 2
- Emscripten/Clang error on setting usertype member variable HOT 4
- Returned Derived Shared Pointer is Nil HOT 1
- AllocConsole and freopen mess up input/output operations HOT 1
- Is it possible to create a user type in Sol3 by ignoring the template arguments? HOT 2
- ADL Customization breaks with `std::vector` and usertype fields
- How to print Error Messages? I am not getting any. HOT 2
- How can I create my own print function in Sol3? HOT 1
- Error when lua require("interop")
- Missing documentation for using Sol to write Lua C libraries HOT 2
- Definition SOL_SAFE_USERTYPE is 0, sol compilation fails HOT 3
- Panic with multiple states HOT 1
- Segfault from protected_function args push HOT 2
- std::terminate called on attempting to index a nil value HOT 2
- Doesn't build with Clang 18.1.0 HOT 9
- Not able to build with CMake HOT 3
- How to pass Lua Closures into C++ Functions in Sol3 ? HOT 4
- Test failure on x86
- Custom module loaders not working? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sol2.