From a8949ec8c1f2ec3f6ea89fd61a2cb4177132b8e2 Mon Sep 17 00:00:00 2001 From: YdrMaster Date: Mon, 15 Jul 2024 11:53:24 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=AE=8C=E6=88=90=2026=20=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: YdrMaster --- exercises/26_std_string/main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/exercises/26_std_string/main.cpp b/exercises/26_std_string/main.cpp index ce0f039b..d8b27627 100644 --- a/exercises/26_std_string/main.cpp +++ b/exercises/26_std_string/main.cpp @@ -1,7 +1,18 @@ #include "../exercise.h" #include +// READ: 字符串 + int main(int argc, char **argv) { - ASSERT(false, "todo!"); + // READ: 字符串字面量 + using namespace std::string_literals; + auto hello = "Hello"s; + auto world = "world"; + // READ: `decltype` 表达式 + // READ: `std::is_same_v` 元编程判别 + ASSERT((std::is_same_v), "Fill in the missing type."); + ASSERT((std::is_same_v), "Fill in the missing type."); + // TODO: 将 `?` 替换为正确的字符串 + ASSERT(hello + ", " + world + '!' == "?", "Fill in the missing string."); return 0; }