| 4636 | { |
| 4637 | template <typename T> |
| 4638 | TOML_NODISCARD |
| 4639 | static std::string make(T&& arg) noexcept |
| 4640 | { |
| 4641 | using arg_type = std::decay_t<T>; |
| 4642 | #if TOML_HAS_CHAR8 |
| 4643 | if constexpr (is_one_of<arg_type, char8_t*, const char8_t*>) |
| 4644 | { |
| 4645 | return std::string(reinterpret_cast<const char*>(static_cast<const char8_t*>(arg))); |
| 4646 | } |
| 4647 | if constexpr (is_one_of<arg_type, std::u8string, std::u8string_view>) |
| 4648 | { |
| 4649 | return std::string(reinterpret_cast<const char*>(static_cast<const char8_t*>(arg.data())), |
| 4650 | arg.length()); |
| 4651 | } |
| 4652 | #endif |
| 4653 | |
| 4654 | #if TOML_ENABLE_WINDOWS_COMPAT |
| 4655 | if constexpr (is_wide_string<arg_type>) |
| 4656 | { |
| 4657 | return narrow(static_cast<T&&>(arg)); |
| 4658 | } |
| 4659 | #endif |
| 4660 | } |
| 4661 | }; |
| 4662 | |
| 4663 | #if TOML_HAS_CHAR8 |
nothing calls this directly
no outgoing calls
no test coverage detected