| 364 | // will be empty strings if the iterator doesn't have a corresponding value. |
| 365 | template <typename First, typename Second> |
| 366 | std::pair<First, Second> ToPair() { |
| 367 | StringPieceTo<First> first_converter; |
| 368 | StringPieceTo<Second> second_converter; |
| 369 | StringPiece first, second; |
| 370 | Iterator it = begin(); |
| 371 | if (it != end()) { |
| 372 | first = *it; |
| 373 | if (++it != end()) { |
| 374 | second = *it; |
| 375 | } |
| 376 | } |
| 377 | return std::make_pair(first_converter(first), second_converter(second)); |
| 378 | } |
| 379 | |
| 380 | // Overloaded InsertInMap() function. The first overload is the commonly used |
| 381 | // one for most map-like objects. The second overload is a special case for |