diff options
Diffstat (limited to 'src/strings/vstring.tcc')
-rw-r--r-- | src/strings/vstring.tcc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/strings/vstring.tcc b/src/strings/vstring.tcc index 1aa163d..4f24a20 100644 --- a/src/strings/vstring.tcc +++ b/src/strings/vstring.tcc @@ -18,8 +18,8 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. #include <cassert> - -#include "../compat/cast.hpp" +#include <cstdarg> +#include <cstdio> #include "rstring.hpp" #include "astring.hpp" @@ -27,7 +27,11 @@ #include "sstring.hpp" #include "zstring.hpp" #include "xstring.hpp" +#include "literal.hpp" + +namespace tmwa +{ namespace strings { template<uint8_t n> @@ -76,11 +80,9 @@ namespace strings *this = XString(v); } template<uint8_t n> - template<size_t m> - VString<n>::VString(const char (&s)[m]) + VString<n>::VString(LString l) { - static_assert(m <= n + 1, "string would truncate"); - *this = XString(s); + *this = XString(l); } template<uint8_t n> VString<n>::VString(decltype(really_construct_from_a_pointer) e, const char *s) @@ -143,7 +145,8 @@ namespace strings char buffer[len + 1]; vsnprintf(buffer, len + 1, fmt, ap); - out = const_(buffer); + out = VString<len>(strings::really_construct_from_a_pointer, buffer); return len; } } // namespace strings +} // namespace tmwa |