Skip to content

Commit 09967bf

Browse files
committed
Swift: add comment about CRTP
1 parent f5b2c31 commit 09967bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

swift/extractor/visitors/VisitorBase.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class VisitorBase {
2525
void visit##CLASS##KIND(swift::CLASS##KIND* e) { dispatcher_.emitUnknown(e); }
2626

2727
// base class for our AST visitors, getting a SwiftDispatcher member and default emission for
28-
// unknown/TBD entities
28+
// unknown/TBD entities. Like `swift::ASTVisitor`, this uses CRTP (the Curiously Recurring Template
29+
// Pattern)
2930
template <typename CrtpSubclass>
3031
class AstVisitorBase : public swift::ASTVisitor<CrtpSubclass>, detail::VisitorBase {
3132
public:
@@ -48,7 +49,8 @@ class AstVisitorBase : public swift::ASTVisitor<CrtpSubclass>, detail::VisitorBa
4849
};
4950

5051
// base class for our type visitor, getting a SwiftDispatcher member and default emission for
51-
// unknown/TBD types
52+
// unknown/TBD types. Like `swift::TypeVisitor`, this uses CRTP (the Curiously Recurring Template
53+
// Pattern)
5254
template <typename CrtpSubclass>
5355
class TypeVisitorBase : public swift::TypeVisitor<CrtpSubclass>, detail::VisitorBase {
5456
public:

0 commit comments

Comments
 (0)