GCC 9.2.0: Fix in the TSTL

This commit is contained in:
Baptiste Wicht 2020-02-21 19:31:05 +01:00
parent 67166266c4
commit 26bbf11772
No known key found for this signature in database
GPG Key ID: C5566B6C7F884532

View File

@ -189,7 +189,9 @@ void fill_n(ForwardIterator first, size_t count, const T& value){
*/ */
template<typename ForwardIterator, typename T, std::enable_if_t<std::is_integral<typename std::iterator_traits<ForwardIterator>::value_type>::value && is_integral<T>::value, int> = 42> template<typename ForwardIterator, typename T, std::enable_if_t<std::is_integral<typename std::iterator_traits<ForwardIterator>::value_type>::value && is_integral<T>::value, int> = 42>
void fill_n(ForwardIterator first, size_t count, const T& value){ 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<char*>(first), count * sizeof(decltype(*first))); memclr(reinterpret_cast<char*>(first), count * sizeof(decltype(*first)));
} else { } else {
if(count > 0){ if(count > 0){