Bounds checking silently disabled on unrecognized containers #991
gregmarr
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For range checking on containers, if any of
size(container)
orssize(container)
or.begin(container) + 2
don't work, then theCPP2_ASSERT_IN_BOUNDS
checking is silently disabled. It seems like for maximum safety, the user should have to either make the container meet the requirements or explicitly opt out using some mechanism like this for cpp1 containers:or some other decoration, perhaps a metaclass, or
unsafe
on theoperator[]
, for cpp2 containers.Beta Was this translation helpful? Give feedback.
All reactions