first version working
[R] use range_value and range_iterator instead of ::iterator and ::value_type