Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 1
    But in STL, iterator classes are defined as a member classes of containers, so std::vector<int>::iterator is valid. Matt Austern's code defines the slist_iterator class to be an outside class of slist.
    – Leedehai
    Commented Aug 25, 2017 at 4:14
  • 1
    @user8385554: I think the idea is that Matt Austern's slist container would have typedefs for iterator and const_iterator to make the iterators available as though they were member types. Commented Sep 5, 2017 at 20:15
  • @L.F.: The question was asked in 2010, before std::conditional_t was a thing. Commented Oct 6, 2019 at 17:15
  • 1
    The original answer was also 2010, but it was link-only and the link eventually rotted. This recreated answer was 2016, but retains the context of the original question. It's true that std::conditional was a thing by 2016, but it wasn't yet implemented in all of the major compilers at that point. Commented Oct 8, 2019 at 23:44
  • Funny, the last link is down.
    – BAKE ZQ
    Commented Aug 26, 2020 at 14:44