]> granicus.if.org Git - llvm/commit
Allow DenseSet::iterators to be conveted to and compared with const_iterator
authorDean Michael Berris <dberris@google.com>
Tue, 24 Jan 2017 04:11:18 +0000 (04:11 +0000)
committerDean Michael Berris <dberris@google.com>
Tue, 24 Jan 2017 04:11:18 +0000 (04:11 +0000)
commitda6e660e1bbdce9a3ba85ac27772c1276c02c5cc
tree9931eb5194f9c6acd19184a3aa374aaee291da9a
parentc144a2489f654c7871cd890fece4f563d5e086e0
Allow DenseSet::iterators to be conveted to and compared with const_iterator

Summary:
This seemed to be an oversight seeing as DenseMap has these conversions.

This patch does the following:
- Adds a default constructor to the iterators.
- Allows DenseSet::ConstIterators to be copy constructed from DenseSet::Iterators
- Allows mutual comparison between Iterators and ConstIterators.

All of these are available in the DenseMap implementation, so the implementation here is trivial.

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D28999

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292879 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/DenseSet.h
unittests/ADT/DenseSetTest.cpp