C++: Improve Iterator.qll layout and QLDoc.

This commit is contained in:
Geoffrey White
2021-02-11 16:44:05 +00:00
parent 90dbbbb0c2
commit da06b2a615

View File

@@ -26,6 +26,14 @@ private class IteratorTraits extends Class {
Type getIteratorType() { result = this.getTemplateArgument(0) }
}
/**
* A type that is deduced to be an iterator because there is a corresponding
* `std::iterator_traits` instantiation for it.
*/
private class IteratorByTraits extends Iterator {
IteratorByTraits() { exists(IteratorTraits it | it.getIteratorType() = this) }
}
/**
* A type which has the typedefs expected for an iterator.
*/
@@ -48,13 +56,9 @@ private class StdIterator extends Iterator, Class {
}
/**
* A type that is deduced to be an iterator because there is a corresponding
* `std::iterator_traits` instantiation for it.
* Gets the `FunctionInput` corresponding to an iterator parameter to
* user-defined operator `op`, at `index`.
*/
private class IteratorByTraits extends Iterator {
IteratorByTraits() { exists(IteratorTraits it | it.getIteratorType() = this) }
}
private FunctionInput getIteratorArgumentInput(Operator op, int index) {
exists(Type t |
t =