r/cpp
•
u/steveklabnik1
•
Oct 24 '24
•
1
Why Safety Profiles Failed
https://www.circle-lang.org/draft-profiles.html
180
Upvotes
View all comments
Show parent comment
4
u/matthieum Oct 26 '24
Would it be possible to use a safe class, unsafely?
That is, if the class constructor or method require invariants that can really only be checked if some
#featureis on, would it still be possible to call it from non-feature enabled code -- perhaps with a#feature nocheck safeor similar -- and leave it up to the user to enforce the invariants?Annotating
#feature nocheckin a scope or whatever is lightweight enough that it wouldn't be a problem.