-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CGAL_assertion(false)/CGAL_error() replace by CGAL_unreachable()? #8295
Comments
Is there really something to discuss? I guess it must be dealt with case by case and cannot be a global replace. |
After an assertion we in general still return something in case the function has a return value. Is this also the case when replacing with the unreachable statement? |
Can a |
Do you agree that we make this to a |
Do you agree that here we cannot replace because it is something that can happen ? |
assertion should be removed |
Does it make sense to have an assertion in |
Shall we make here the last |
I would remove it |
So unreachable means that one may still arrive there in practice? |
In this case, it emits an assertion while returning |
But when we may arrive at that point, we maybe want to get an exception thrown by a custom error handler. |
Shall we declare this copy constructor private instead? |
you can assume it!=end since there is a check before |
Would this also compile if the static function here was just removed? After all we need the class only because of the offered specializations. |
Indeed, you should get a compilation error instead of a runtime error. |
To make it very clear we could even declare the constructor |
Make it |
I agree it should be removed. Once it is remove, if a user-code uses |
There should be only a declaration of the template, without any definition. Just: template<typename HEG, unsigned int i> struct Get_beta; |
Here we have the assertion as first line of a function. |
Is there a subtlety I miss here which makes that there is a |
git blame says that the code is 16yo and from Peter. So basically it was always there. We can remove the function. |
@sloriot any idea what the function |
probably a leftover after some refactoring. |
The functor Test_split_nonvoid_attribute_functor_run<CMap, i, j> tests if i-attributes are split after an operation, except for j-attributes. As said in the comments, for j==0 or j==1, we use only the version with two lists of darts, thus this run method is never called (but should exist for the compiler). |
There are more than 250 occurrences of
CGAL_assertion(false)
in CGAL. And other occurrences ofCGAL_error()
. Should not we replace them withCGAL_unreachable()
?The text was updated successfully, but these errors were encountered: