| 707 | // in range [0, v.size()). |
| 708 | template <typename E> |
| 709 | inline E GetElementOr(const std::vector<E>& v, int i, E default_value) { |
| 710 | return (i < 0 || i >= static_cast<int>(v.size())) ? default_value : v[i]; |
| 711 | } |
| 712 | |
| 713 | // Performs an in-place shuffle of a range of the vector's elements. |
| 714 | // 'begin' and 'end' are element indices as an STL-style range; |
no test coverage detected