Can't understand return type of qBinaryFind();
-
I read all documentation which concerning this function(all 3 variations), and still can't get why developers did'nt make as return type just vector of ints... I tried as at example, and it gives an error:
P.S. tried to set return value to *uchar as compiler asks, it always return 253 in any case. Confused.
-
Hi,
In addition to @mranger90, as suggested in the current documentation, you should
use std::binary_search or std::lower_bound instead
. -
@Engelard said in Can't understand return type of qBinaryFind();:
P.S. still can't understand the point of iterator type, why dont use simple int instead?
Because you can use the iterator as parameter to any other function which expects an iterator.
I guess these functions are deprecated because the standard C++ library now provides same functionality.
-
No they are not, Qt's containers are implicitly shared which is not the case of the STD containers.