From 624fdcd58e054b430ea616a0359b35243a8a5d04 Mon Sep 17 00:00:00 2001 From: sekka16 <729840088@qq.com> Date: Thu, 11 Jul 2024 17:56:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0sfinae?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/_posts/language/{ => cpp}/operator.md | 0 source/_posts/language/cpp/sfinae.md | 18 ++++++++++++++++++ source/_posts/language/{ => cpp}/valarray.md | 0 3 files changed, 18 insertions(+) rename source/_posts/language/{ => cpp}/operator.md (100%) create mode 100644 source/_posts/language/cpp/sfinae.md rename source/_posts/language/{ => cpp}/valarray.md (100%) diff --git a/source/_posts/language/operator.md b/source/_posts/language/cpp/operator.md similarity index 100% rename from source/_posts/language/operator.md rename to source/_posts/language/cpp/operator.md diff --git a/source/_posts/language/cpp/sfinae.md b/source/_posts/language/cpp/sfinae.md new file mode 100644 index 0000000..2b12292 --- /dev/null +++ b/source/_posts/language/cpp/sfinae.md @@ -0,0 +1,18 @@ +--- +title: C++中的SFINAE +date: 2024-07-11 21:00:00 +tags: +categories: +description: +--- + +# Substitution Failure Is Not An Error + +## 模板的特化(非必须) + + +## SFINAE的基本原理 + +**核心思想:**当编译器在模板实例化过程中尝试替换模板参数时,如果替换失败,编译器不会报错而是尝试其他可能的重载,只有当所有可能的重载全部都失败时,编译器才会报错。 + + diff --git a/source/_posts/language/valarray.md b/source/_posts/language/cpp/valarray.md similarity index 100% rename from source/_posts/language/valarray.md rename to source/_posts/language/cpp/valarray.md