You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
This does not warn, even though it's basically the same example and I tried to annotate VS as being an owner. Is there some way to still get a warning for such code?
This seems to be an issue with determining the pointee type of the Owner VS.
Adding some debugging and an extra member makes it correctly deduce the pointee type, see https://godbolt.org/z/Erb77o
I thought that [[gsl::Owner(std::string)]] was a way to manually specify that, but it didn't work.
Also declaring operator[] is supposed to be enough to correctly determine the pointee type.
Here's a simple example:
This, correctly and awesomely, issues a warning on the for loop because of the object being destroyed. Cool.
Now let's say I have my own custom vector of strings, which I'm calling
VS
because I'm not creative:This does not warn, even though it's basically the same example and I tried to annotate
VS
as being an owner. Is there some way to still get a warning for such code?Obligatory compiler explorer link.
The text was updated successfully, but these errors were encountered: