<div dir="ltr">On Wed, Aug 21, 2013 at 4:40 PM, Samuel Benzaquen <span dir="ltr"><<a href="mailto:sbenza@google.com" target="_blank">sbenza@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
================<br>
Comment at: include/clang/ASTMatchers/Dynamic/VariantValue.h:140<br>
@@ +139,3 @@<br>
+  };<br>
+  union {<br>
+    SingleRep *AsSingle;<br>
----------------<br>
</div><div class="im">Manuel Klimek wrote:<br>
> Any reason not to use an interface with two implementations? This smells a lot like building our own inheritance implementation ...<br>
</div>These two could hide behind an interface, but I don't know how the interface would work for the variadic case coming next (from D1427).<br>
The basic idea for that one is that on getTypedMatcher<T> it will convert all the inner matchers to Matcher<T>, then create a VariadicOperatorMatcherInterface<T> with them and return it.<br>
If I try to use interfaces, I will need two: one for the payload of the matcher, and one for the operations from <T>. It can be done, but it might be messier.<br>
I'll give it a try to see how it looks.<br></blockquote><div><br></div><div>Thx.</div><div><br></div></div></div></div>