Added etl::generate algorithm

This commit is contained in:
John Wellbelove 2023-12-17 12:54:01 +00:00
parent 59cd9e66d7
commit 7bb125a360

View File

@ -169,6 +169,18 @@ namespace etl
return first2;
}
//***************************************************************************
// generate
template <typename TIterator, typename TFunction>
ETL_CONSTEXPR14
void generate(TIterator db, TIterator de, TFunction funct)
{
while (db != de)
{
*db++ = funct();
}
}
//***************************************************************************
// copy
#if ETL_USING_STL && ETL_USING_CPP20