In RewritePattern, only expose matchAndRewrite as a public function. match can be protected (but needs to be protected because we want to call it from an override of matchAndRewrite). rewrite can be private.
For classes deriving from RewritePattern, all 3 functions can be private.
Side note: I didn't understand the need for the using RewritePattern::matchAndRewrite in derived classes, and started poking around. They are gone now, and I think the result is (only very slightly) cleaner.