3 ms·
restrict in C++ can't work well. One can mark pointer parameters with this attribute, but in C++ it's not recommended to pass raw pointers, std::string_view or
by Panzerschrek 5mo ago
restrict in C++ can't work well. One can mark pointer parameters with this attribute, but in C++ it's not recommended to pass raw pointers, std::string_view or std::span should be used instead, but there is no way to specify restrict for the internal pointer of these containers.
- arcadialeak 5mo ago> std::string_view or std::span should be used instead That is for when the owner is a std::string or an owning range respectively. But a raw pointer does still make sense as a non-owning view over a single element, doesn't it? I'm new to C++ so I might be wrong.
- cocoto 5mo agoNon-owning view over a single element should simply be a reference, you don’t care where this element is located.
- 1718627440 5mo agoThat won't work with NULL.