New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unique table identifier? #1555
Comments
Maybe sol::table::pointer does this? |
Not 100% sure, but fairly sure there is no unique value you can get from the lua API. 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 |
I am writing some code to convert a sol::table into a C++ structure, and I want to prevent infinite recursive loops from forming when a table has itself somewhere in one of its own keys, or in the sub-structure.
What can I use as a unique identifier for the table? I tried registry_index() but I thing this value changes as I am traversing through the data...
The text was updated successfully, but these errors were encountered: