diff --git a/tstl/include/algorithms.hpp b/tstl/include/algorithms.hpp index 48407757..f020995a 100644 --- a/tstl/include/algorithms.hpp +++ b/tstl/include/algorithms.hpp @@ -189,7 +189,9 @@ void fill_n(ForwardIterator first, size_t count, const T& value){ */ template::value_type>::value && is_integral::value, int> = 42> void fill_n(ForwardIterator first, size_t count, const T& value){ - if(!value){ + // TODO This is definitely not good, should properly compare to zero + bool v{value}; + if(!v){ memclr(reinterpret_cast(first), count * sizeof(decltype(*first))); } else { if(count > 0){