MOS Source Code
Loading...
Searching...
No Matches
string.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#include "mos/string.hpp"
4
5#include <mos_stdio.hpp>
6
7namespace mos
8{
9 mos::string to_string(const void *value)
10 {
11 char buf[32];
12 const auto sz = snprintf(buf, sizeof(buf), "%p", value);
13 return mos::string(buf, sz);
14 }
15} // namespace mos
mos::string to_string(const void *value)
Definition string.cpp:9
mos::basic_string< char, mos::default_allocator > string
Definition string.hpp:352
int snprintf(char *__restrict str, size_t size, const char *__restrict format,...)
Definition mos_stdio.cpp:16