| 52 | |
| 53 | template<typename STR> |
| 54 | void CopyToStringT(const BasicStringPiece<STR>& self, STR* target) { |
| 55 | if (self.empty()) |
| 56 | target->clear(); |
| 57 | else |
| 58 | target->assign(self.data(), self.size()); |
| 59 | } |
| 60 | |
| 61 | void CopyToString(const StringPiece& self, std::string* target) { |
| 62 | CopyToStringT(self, target); |