libunifex
libunifex copied to clipboard
adding complete_adapt_stream algorithm
similar to next_adapt_steram, adding complete_adapt_stream
Could this instead be written as using the existing adapt_stream
algorithm but passing the identity function for the adapt_next
param? That would make this algorithm more maintainable in the long run.
I used the next_adapt_stream implementation as a template for this algorithm. I can see how both next_adapt_stream and complete_adapt_stream can be written on top of adapt_stream. I am assuming this would be more optimal implementation since it saves some bytes for storing the transformation lambda for the other signal which is not used.
If the function is just an identity transformation then it shouldn't take up any additional space in the adapt_stream
type (so long as the functions are annotated with [[no_unique_address]]
). Check out this godbolt for an example of how wrapping an identity transform function doesn't require additional storage in the wrapper class.