From 7a027cab180c741b6fb5b64d48b5ae99fe6e09c3 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Fri, 14 Oct 2016 08:07:43 +0200 Subject: [PATCH] Fix memclr optimization --- tstl/include/algorithms.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tstl/include/algorithms.hpp b/tstl/include/algorithms.hpp index 5313c10f..d799e9cf 100644 --- a/tstl/include/algorithms.hpp +++ b/tstl/include/algorithms.hpp @@ -169,7 +169,7 @@ void fill(ForwardIterator first, ForwardIterator last, const T& value){ * \param count The number of elements * \param value The value to write */ -template::value_type>::value, int> = 42> +template::value_type>::value && is_integral::value), int> = 42> void fill_n(ForwardIterator first, size_t count, const T& value){ if(count > 0){ *first = value; @@ -187,7 +187,7 @@ void fill_n(ForwardIterator first, size_t count, const T& value){ * \param count The number of elements * \param value The value to write */ -template::value_type>::value, int> = 42> +template::value_type>::value && is_integral::value, int> = 42> void fill_n(ForwardIterator first, size_t count, const T& value){ if(!value){ memclr(reinterpret_cast(first), count * sizeof(decltype(*first)));