| 4 | template<typename T> struct string_builder_helper; |
| 5 | |
| 6 | template <typename A, typename B> struct string_builder { |
| 7 | typedef string_builder_helper<A> HA; |
| 8 | typedef string_builder_helper<B> HB; |
| 9 | operator std::string() const { |
| 10 | std::string s; |
| 11 | s.reserve(size()); |
| 12 | HA::append_to(s, a); |
| 13 | HB::append_to(s, b); |
| 14 | return s; |
| 15 | } |
| 16 | unsigned int size() const { return HA::size(a) + HB::size(b); } |
| 17 | |
| 18 | string_builder(const A &a, const B &b) : a(a), b(b) {} |
| 19 | const A &a; |
| 20 | const B &b; |
| 21 | }; |
| 22 | |
| 23 | template<> struct string_builder_helper<std::string> { |
| 24 | typedef std::string T; |
nothing calls this directly
no outgoing calls
no test coverage detected