]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common: add comment to explain the partial specialization 37127/head
authorKefu Chai <kchai@redhat.com>
Mon, 14 Sep 2020 02:14:01 +0000 (10:14 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 14 Sep 2020 02:14:05 +0000 (10:14 +0800)
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 <kchai@redhat.com>
src/crimson/common/errorator.h

index e2c992fad1f42612e99b4259d3a59e63c4e873e8..16335380192c94e470fd13abd4c47d1b7f2e4640 100644 (file)
@@ -835,6 +835,9 @@ private:
   class futurize {
     using vanilla_futurize = seastar::futurize<T>;
 
+    // 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 <class Stored, int Dummy = 0>
     struct stored_to_future {
       using type = future<Stored>;