iota_iterator: constrain value type

This commit is contained in:
skypjack
2026-01-21 15:00:05 +01:00
parent 7d50da0463
commit 80ffcda35d

View File

@@ -53,11 +53,8 @@ private:
* @brief Plain iota iterator (waiting for C++20).
* @tparam Type Value type.
*/
template<typename Type>
class iota_iterator final {
static_assert(std::is_integral_v<Type>, "Not an integral type");
public:
template<std::integral Type>
struct iota_iterator final {
/*! @brief Value type, likely an integral one. */
using value_type = Type;
/*! @brief Invalid pointer type. */