Add support for std::iota (#4481)

* Add support for std::copy_n/merge/stable_sort

* Format

* Add support for std::unordered_set::count(), std::push_heap

* Missing include

* Add support for std::iota

* Missing include
This commit is contained in:
chrchr-github 2022-09-20 07:30:24 +02:00 committed by GitHub
parent dcb332acb0
commit 2ce25abd81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View File

@ -7634,6 +7634,22 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
<arg nr="3" direction="in"/> <arg nr="3" direction="in"/>
<arg nr="4" direction="in" default=""/> <arg nr="4" direction="in" default=""/>
</function> </function>
<!-- template< class ForwardIt, class T > void iota( ForwardIt first, ForwardIt last, T value ); -->
<function name="std::iota">
<noreturn>false</noreturn>
<returnValue type="void"/>
<arg nr="1">
<not-uninit/>
<iterator container="1" type="first"/>
</arg>
<arg nr="2">
<not-uninit/>
<iterator container="1" type="last"/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
</arg>
</function>
<!-- @todo: iterator iterator erase (const_iterator position); --> <!-- @todo: iterator iterator erase (const_iterator position); -->
<!-- iterator std::vector::erase( iterator first, iterator last ); --> <!-- iterator std::vector::erase( iterator first, iterator last ); -->
<!-- iterator std::map::erase( iterator first, iterator last ); --> <!-- iterator std::map::erase( iterator first, iterator last ); -->

View File

@ -37,6 +37,7 @@
#include <vector> #include <vector>
#include <unordered_set> #include <unordered_set>
#include <algorithm> #include <algorithm>
#include <numeric>
int zerodiv_ldexp() int zerodiv_ldexp()
{ {
@ -3012,6 +3013,13 @@ void uninitvar_copy_n(const std::vector<int>& v)
std::copy_n(v.begin(), -1, dst); std::copy_n(v.begin(), -1, dst);
} }
void uninitvar_iota(std::vector<int>& v)
{
int i;
// cppcheck-suppress uninitvar
std::iota(v.begin(), v.end(), i);
}
void uninitvar_putc(void) void uninitvar_putc(void)
{ {
int c; int c;