-
Notifications
You must be signed in to change notification settings - Fork 117
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
fatal error: recursive template instantiation exceeded maximum depth of 256 #167
Comments
Add this to the CMakeList.txt :
|
Selene is header only, so this change would need to be added to the project that includes selene. So perhaps adding this to the README would be most prudent. |
yet it ship with a CMakeList.txt file. This is the one that any user will have a look for his own as reference. So imho, it's the best place to document this. Well there and here in the Selene issue's lists as it's actually the 1rst place I gave a look to fix my issue :P |
Yes it is a good place to document it here. |
I've also run into this issue. I would like to find a way to sequentially append functions to an object once it has already been registered within Selene, i.e. something equivalent to the following (using the original example code from above):
The library is a bit beyond my current comprehension of C++ templates though. Any pointers or suggestions would be welcome, and I will try to implement. |
Couldn't you just assign it such as ["p_serv"]["addCollector"] = method; ? An object is just a table so to add new methods to an object you just add to its table. At least that's my, limited, understanding. |
Thanks for the suggestion! That won't quite compile, but using the provided So you can add as many methods as you want (well at least it compiles without increasing the stack depth now, whereas using the single function call it won't), by doing the following:
|
Hi,
This is not exactly a Selene issue but a clang one. Most complier have a max depth of 1024, but clang set this way lower. and as Selene use template extensively, the 256 limit is fast to cross :
Trigger the error; remove a pair of argument and it compile fine.
The fix is to tell clang to behave like gcc on this with the compiler flags : "-ftemplate-depth=1024"
The text was updated successfully, but these errors were encountered: