Closed DNKpp closed 10 months ago
So, any comments on this? Shall I compile a pull request or is there any information needed?
Sorry, I completely missed this. Thank you for pinging me. Please do make a PR, that would be very much appreciated.
Thank you so much for the fix. I'm leaving this open until a new release has been tagged.
Tagged v46 so closing now. Thanks again.
Hello, with the arise of c++20 and its ranges namespace, providing views as parameters become more and more common. Unfortunatly
trompeloeil
doesn't fully support that, because the traits for thestreamer
primary template aren't precise enough.Currently we have
This is problematic in situations, where
T
providesbegin
andend
members, but only for non-const access. This may and will happen, when you use some advanced views. Unfortuantly this results in a huge compile error. Have a look at std::views::owning, which always offers abegin
andend
implementation, but conditionally enables the const overloads.I think, the constraint can simply be fixed by simply adding const (at least in my project that works like a charm), as the streamer also uses a
const T&
.EDIT: An alternative would be, to relax the
streamer::print
param to non-const, but this is probably not desired, as astreamer
should not alter the streamed object in any way. So, I think it would be best, to stick with theconst T&
and strengthening the traits.