File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp/models/implementations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ private class IteratorTraits extends Class {
2929/**
3030 * A type which has the typedefs expected for an iterator.
3131 */
32- private class IteratorByTypedefs extends Class {
32+ private class IteratorByTypedefs extends Iterator , Class {
3333 IteratorByTypedefs ( ) {
3434 this .getAMember ( ) .( TypedefType ) .hasName ( "difference_type" ) and
3535 this .getAMember ( ) .( TypedefType ) .hasName ( "value_type" ) and
@@ -43,18 +43,17 @@ private class IteratorByTypedefs extends Class {
4343/**
4444 * The `std::iterator` class.
4545 */
46- private class StdIterator extends Class {
46+ private class StdIterator extends Iterator , Class {
4747 StdIterator ( ) { this .hasQualifiedName ( "std" , "iterator" ) }
4848}
4949
5050/**
51- * Implements `Iterator`.
51+ * A type that is deduced to be an iterator because there is a corresponding
52+ * `std::iterator_traits` instantiation for it.
5253 */
53- private class IteratorImpl extends Iterator {
54- IteratorImpl ( ) {
55- this instanceof IteratorByTypedefs or
56- exists ( IteratorTraits it | it .getIteratorType ( ) = this ) or
57- this instanceof StdIterator
54+ private class IteratorByTraits extends Iterator {
55+ IteratorByTraits ( ) {
56+ exists ( IteratorTraits it | it .getIteratorType ( ) = this )
5857 }
5958}
6059
You can’t perform that action at this time.
0 commit comments