-
Notifications
You must be signed in to change notification settings - Fork 43
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
A few small suggestions #3
Comments
Thanks for your detailed feedback and suggestions! The underlying idea of this implementation of To prevent surprises when transitioning to
Providing [1] If requested via |
For std::lexicographical_compare(), std::equal()
…nks to @chris0e3) also in as_writeable_bytes()
span comparison are not up to date with /heterogeneous/ comparisons introduced in p0122r7.
@chris0e3 In |
I agree that you should follow ‘the spec’. However, the spec has yet to be finalised - and as such there is the possibility to change it. For some reason I had convinced myself that I now see how Anyway, after writing the original message it occurred to me that my
and
should fix the problems. The following tests cover the changes:
|
@martinmoene, I sometimes prefer that form (in non-template code) as it’s possible to change the type of a var in a declaration and forget to change other Feel free to use, not use, or change any code I have submitted - as you see fit. |
Re: sizeof(t) vs sizeof(T): memory refreshed ;)
It is my intention that that works. I'll have to glean the Travis knowledge to also have it verified, e.g. at Catch.
Apart from
I agree.
|
Plan:
Postpone:
|
I meant offering the source for inclusion (as part of) libc++.
I didn’t realise
I meant to mention that. It could be a free function.
Not Note: |
Ah, I think there's no need to 'alert' Marshall Clow @mclow, Jonathan Wakely @jwakely and @StephanTLavavej on this to craft span into liblibstdstlstlc++++ (oh, I just did ;) If your remark concerns promoting If you like I can do that. |
controlled via span_CONFIG_PROVIDE_BACK_FRONT
controlled via span_CONFIG_PROVIDE_SAME
No, actually my suggestion stands regardless of any additions to the (proposed) standard.
Go for it! Also, I notice that |
Just FYI - I have an implementation that I haven't yet merged into libc++. It's waiting on more complete tests. I'll probably land it when I get back from C++Now. |
@mclow Thanks for letting us know Marshall. |
@martinmoene, @chris0e3 - thanks for thinking of me. |
Great job. Thanks for creating & releasing this.
Have you considered offering it for use in libc++/clang?
It would be good if you could add the static size optimisation (at some point).
I have been experimenting with it & testing it with Clang 6.0 & C++17.
Here’s my feedback & suggestions:
#include <algorithm>
(for lexicographical_compare).with_container_t
stuff appears redundant (with Clang 6.0 & C++17).namespace nonstd
addusing span_lite::as_bytes;
andusing span_lite::as_writeable_bytes;
(after line 932).I fixed it by adding
template<class T> struct is_span_oracle<span<T>> : std::true_type {};
(by the currentis_span_oracle
) and changed operator==, != etc. to something like:as_bytes
&as_writeable_bytes
have a mistake in their disabled lines (closing paren in wrong plac)e:return { reinterpret_cast< std::byte const * >( spn.data(), spn.size_bytes() ) };
should be:
return { reinterpret_cast<std::byte const*>(spn.data()), spn.size_bytes() };
^
And
return { reinterpret_cast< std::byte * >( spn.data(), spn.size_bytes() ) };
should be:
return { reinterpret_cast<std::byte*>(spn.data()), spn.size_bytes() };
^
make_span
functions:cdata
,front
&back
member functions (with the obvious impls).The text was updated successfully, but these errors were encountered: