includes/std: Fixed NullString not including null terminator and not checking for string end correctly

This commit is contained in:
Nik
2024-06-23 18:45:13 +02:00
committed by GitHub
parent e4c9d86755
commit 26878548f0

View File

@@ -1,6 +1,7 @@
#pragma once
import std.io;
import std.mem;
/*!
Libray to interact with strings.
@@ -35,7 +36,8 @@ namespace auto std::string {
@tparam DataType The type of the characters.
*/
struct NullStringBase<DataType> {
DataType string[while($[$] != 0x00)];
DataType string[while(std::mem::read_unsigned($, sizeof(DataType)) != 0x00)];
DataType null_terminator;
} [[sealed, format("std::string::impl::format_string"), transform("std::string::impl::format_string")]];
/**