From ac58f85e13fdd0d775d59f55718ecf726ce70260 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 14 Sep 2020 10:14:01 +0800 Subject: [PATCH] crimson/common: add comment to explain the partial specialization MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit it might be confusing why we don't use explicit specialization for defining errorator::futurize::stored_to_future. quote from item 16, § 17.7.3, n4659: In an explicit specialization declaration for a member of a class template or a member template that appears in namespace scope, the member template and some of its enclosing class templates may remain unspecialized, except that the declaration shall not explicitly specialize a class member template if its enclosing class templates are not explicitly specialized as well. Signed-off-by: Kefu Chai --- src/crimson/common/errorator.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index e2c992fad1f42..16335380192c9 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -835,6 +835,9 @@ private: class futurize { using vanilla_futurize = seastar::futurize; + // explicit specializations for nested type is not allowed unless both + // the member template and the enclosing template are specialized. see + // section temp.expl.spec, N4659 template struct stored_to_future { using type = future; -- 2.47.3