Sorry - yes, I think it is best if this only applies to pointer like types (since arguably at least there's implementation defined ordering for llvms hash containers for now, it's sort of relying on an implementation detail but anyway<div><br></div><div>What I meant about is_pointer is that I was looking for something probably named is_pointer_like (or perhaps IsPointerLike), but whatever the name - the implementation is what I was/am concerned with. I don't want it tone another trait that everything that currently implements PointerLikeTypeTraots would have to also implement. I was hoping to define IsPointerLike in terms of the existing IsPointerLikeTypeTraits. So that the two would not diverge unnecessarily.<br><br><div class="gmail_quote"><div dir="ltr">On Sun., 6 Aug. 2017, 10:33 pm Grang, Mandeep Singh <<a href="mailto:mgrang@codeaurora.org">mgrang@codeaurora.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p><font size="+1">I have removed the is_pointer trait. I thought we
        wanted it to work exactly for all pointer and pointer-like types.
        That's the reason I had an is_pointer trait.</font></p>
    <p><font size="+1">So now how do we define the behavior for reverse
        iteration? It is no longer tied to pointer types, right? As long
        as a type is complete it will reverse iterate.</font><br>
    </p></div><div text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="m_6070037831946000359moz-cite-prefix">On 8/6/2017 3:17 PM, David Blaikie
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">I'd still prefer not to build another trait for
        this unless we have to - is there a reason we'd want is_pointer
        to not be true for some types that are PointerLike? (or
        conversely, for it to be true for some types that aren't
        PointerLike)</div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Sun, Aug 6, 2017 at 11:52 AM Mandeep Singh
          Grang via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">mgrang added
          inline comments.<br>
          <br>
          <br>
          ================<br>
          Comment at: include/llvm/Support/PointerLikeTypeTraits.h:35<br>
          +// Trait to check if T is pointer.<br>
          +template<typename T><br>
          +struct is_pointer { static const bool value = false; };<br>
          ----------------<br>
          mgrang wrote:<br>
          > Just checking if T is a complete type is not enough due
          to the presence of specialization for const T:<br>
          > template <typename T> class
          PointerLikeTypeTraits<const T><br>
          ><br>
          > In this case, for a const int the type is complete but
          it's not a pointer type. So to handle such cases I had to
          check for is_pointer too.<br>
          We might as well not check for is_complete and just check for
          is_pointer, and then add more specialization for is_pointer of
          other ptr types (like shared, unique ptr, etc)?<br>
          <br>
          <br>
          Repository:<br>
            rL LLVM<br>
          <br>
          <a href="https://reviews.llvm.org/D35043" rel="noreferrer" target="_blank">https://reviews.llvm.org/D35043</a><br>
          <br>
          <br>
          <br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </div></blockquote></div></div>