<div dir="ltr"><div>BTW, this is what i came up with, not sure if anyone has a better way</div><div><br></div><div>inline hash_code hash_value(const AtomicOrdering &AO) {</div><div>  return static_cast<typename std::underlying_type<AtomicOrdering>::type>(AO);</div><div>}</div><div><br></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 8, 2016 at 3:03 PM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dberlin added a subscriber: dberlin.<br>
dberlin added a comment.<br>
<span class="im HOEnZb"><br>
This breaks the ability to hash them :)<br>
<br>
IE, i have a hash function that does:<br>
return hash_combine(A->getType(), A->getPointerOperand()->getType(),<br>
<br>
  A->getValueOperand()->getType(), A->isVolatile(),<br>
  A->getAlignment(), A->getOrdering(),<br>
  A->getSynchScope());<br>
<br>
now the hash on getOrdering fails with wonderful template messages.<br>
<br>
Can you define hash_value for it (see ADT/Hashing.h)?<br>
<br>
(The hash works on getSynchScope because it's not an enum class, just an<br>
enum)<br>
<br>
<br>
</span><div class="HOEnZb"><div class="h5">Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D18775" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18775</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>