-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Allow forward declaration of type T in reader<T> class member #185
Comments
|
@tusooa My understanding is that |
This could be indeed a very nice feature... |
After benchmarking the changes I mentioned above, I measured a ~40% performance decrease in the creation of a random DAG made up of readers. Considering that changing the type of For reference, here are the changes that allowed forward declaration of |
Thank you so much for the investigation @TheCoconutChef ! |
Consider:
as of right now, this will not compile due to the use of
value_type current_/last_
inreader_node<T>
.However, if we swap
value_type
for, say,std::unique_ptr<value_type>
with appropriate modification to the ctor, thelast()
method, thecurrent()
method, and the variouspush/send
method, it seemingly "just work".I understand that changing substituting
std::unique_ptr<value_type>
forvalue_type
would require extra allocation atreader_node
construction, which is a downside. However, the ability to forward declareT
ofreader<T>
might be worth it? Was the inability to do so ever a problem, or are there other reasons that would recommend against such a change?The text was updated successfully, but these errors were encountered: