mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 13:48:53 +02:00
ircd::util: Add string() convenience to 'to_string' an object stream.
This commit is contained in:
parent
f446081021
commit
7bc7d37052
1 changed files with 9 additions and 0 deletions
|
@ -240,6 +240,15 @@ microtime(char *const &buf,
|
|||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
std::string
|
||||
string(const T &s)
|
||||
{
|
||||
using std::stringstream;
|
||||
return static_cast<stringstream &>(stringstream{} << s).str();
|
||||
}
|
||||
|
||||
|
||||
} // namespace util
|
||||
} // namespace ircd
|
||||
#endif // __cplusplus
|
||||
|
|
Loading…
Reference in a new issue