<div>It is kinda confusing, but not that much. I think the main problem is that it isn&#39;t intuitive. </div><div><br></div><div>One usually expects the <b>operator==</b> to be symmetric, and in this case it isn&#39;t. Moreover spotting bugs would be even harder. Why don&#39;t you simply overload the <b>operator !=</b> ?</div>
<div><br></div><div>That way I could come up with queries like -</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>(Vocabulary::NAO::numericRating() &lt; RATING ) &amp;&amp; ( Vocabulary::NAO::hasTag() != TAG )</div>
</blockquote><div><br></div><div>- Vishesh Handa </div><br><div class="gmail_quote">On Sun, Jul 25, 2010 at 2:00 AM, Artem Serebriyskiy <span dir="ltr">&lt;<a href="mailto:v.for.vandal@gmail.com">v.for.vandal@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">As for me, it is too confusing.<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Sun, Jul 25, 2010 at 12:15 AM, Sebastian Trüg <span dir="ltr">&lt;<a href="mailto:trueg@kde.org" target="_blank">trueg@kde.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">

Hi guys,<br>
<br>
at the Akademy a very good idea came up: using C++ operator overloads to<br>
construct queries. This is very straight-forward for AndTerm and OrTerm:<br>
<br>
   term1 &amp;&amp; term2 &amp;&amp; term3<br>
<br>
   term1 || term2 || term3<br>
<br>
But it gets nicer (thanks to Vishesh for the tip):<br>
<br>
   Vocabulary::NIE::contentCreated() &gt; Query::LiteralTerm( dateTime1 );<br>
   Vocabulary::NAO::hasTag() == term;<br>
<br>
which results in the following ComparisonTerms:<br>
<br>
   ComparisonTerm(<br>
        Vocabulary::NIE::contentCreated(),<br>
        Query::LiteralTerm( dateTime1 ),<br>
        ComparisonTerm::Greater );<br>
<br>
   ComparisonTerm(<br>
        Vocabulary::NAO::hasTag(),<br>
        term,<br>
        ComparisonTerm::Equal );<br>
<br>
So far so good. But now let me give you the idea which I would like some<br>
feedback on. By interchanging the two parameters of the operator we<br>
create an inverted ComparisonTerm:<br>
<br>
   term == Vocabulary::NAO::hasTag();<br>
<br>
will create the following term:<br>
<br>
   ComparisonTerm(<br>
        Vocabulary::NAO::hasTag(),<br>
        term,<br>
        ComparisonTerm::Equal ).inverted();<br>
<br>
For me this is very convenient. But it might be rather confusing. But<br>
then again inverted terms are confusing to begin with.<br>
<br>
So any opinions?<br>
<br>
Cheers,<br>
Sebastian<br>
_______________________________________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org" target="_blank">Nepomuk@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
</blockquote></div><br><br clear="all"><br></div></div>-- <br>Sincerely yours,<br><font color="#888888">Artem<br>
</font><br>_______________________________________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
<br></blockquote></div><br>