20 #include <bsoncxx/stdx/string_view.hpp>
22 #include <bsoncxx/config/prelude.hpp>
25 BSONCXX_INLINE_NAMESPACE_BEGIN
28 template <
class CharT,
29 class Traits = std::char_traits<CharT>,
30 class Allocator = std::allocator<CharT>>
31 BSONCXX_INLINE std::basic_string<CharT, Traits, Allocator>
to_string(
32 stdx::basic_string_view<CharT, Traits> value,
const Allocator& alloc = Allocator()) {
33 return std::basic_string<CharT, Traits, Allocator>{value.data(), value.length(), alloc};
37 BSONCXX_INLINE_NAMESPACE_END
40 #include <bsoncxx/config/postlude.hpp>