I see this post which explain the const_cast<>
and says it is beneficial when pointers/references are used. However, consider the following codes:
1-
const_cast<SCOTCH_Num*>(xadj)
which I get invalid const_cast from type 'cost label* {aka const long int *}' to type 'SCOTCH_Num* {aka int*}'
. So, pointers are casted. Isn't that?
and
2-
(SCOTCH_Num*)(xadj)
which I get warning: use of old-style cast [-Wold-style-cast]
You may ask about the variable definitions, but the aka
part in the error is clear. If I have propose more details, please let me know.