blob: 9084e8137aa61c4c6b49fbe066d3f3fb77ac21e7 (
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
36
|
#ifndef UTIL_H_440DEAA0
#define UTIL_H_440DEAA0
#include <string>
#include <sstream>
#include <memory>
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 */
|