Why does CLion think this 'recurses indefinitely'?
已回答
Because stl algorithms on collections usually are range based, i.e. of form f( start_it, end_it, ...), but usually those functions are used for the whole collection, I like to define functions of the form f( collection, ...). For example, for find_if:
template <class COLLECTION, class PREDICATE>
typename COLLECTION::iterator find_if( COLLECTION& collection, PREDICATE predicate ) {
return find_if( collection.begin(), collection.end(), predicate );
}
And I get the following warning during commit:
Warning:(39, 32) Function 'find_if' recurses infinitely
请先登录再写评论。
Hello! I can reproduce the issue in CLion 2018.2.4 and can't reproduce it in CLion 2018.3 EAP. Could you please try using CLion 2018.3 EAP and check whether the issue is still actual in it on your side?
Thank you. Yes, don't see the problem in 2018.3 EAP.