blob: 2f4b9a359bf1113ed4a6a38d861ed050a98c8422 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#ifndef UTIL_H_440DEAA0
#define UTIL_H_440DEAA0
#include <string>
#include <sstream>
namespace twitter {
template <class InputIterator>
std::string implode(InputIterator first, InputIterator last, std::string delimiter)
{
std::stringstream result;
for (InputIterator it = first; it != last; it++)
{
if (it != first)
{
result << delimiter;
}
result << *it;
}
return result.str();
}
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
};
#endif /* end of include guard: UTIL_H_440DEAA0 */
|