Nie sądzę, to będzie działać tak po wyjęciu z pudełka, co equal_range
zwraca parę iteratorów while, for cyklu nad zakresem według documentation są:
The begin_expr and end_expr are defined to be either:
If (__range) is an array, then (__range) and (__range + __bound), where __bound is the array bound
If (__range) is a class and has either a begin or end member (or both), then begin_expr is __range.begin() and end_expr is __range.end();
Otherwise, begin(__range) and end(__range), which are found based on argument-dependent lookup rules with std as an associated namespace.
Powiedziałbym, że możesz zdefiniować funkcje begin
i end
, które zajmują parę iteratorów i zwracają pierwszą i drugą ponownie.
Czy możesz użyć wzmocnienia? – inf
Jeśli możesz użyć boost, boost ma iterator zakresu. – OmnipotentEntity
Tak, mogę i robię :) <3 boost – NoSenseEtAl