Function operator<<=

Synopsis

#include <include/EASTL/bitset.h>

this_type & operator<<=(size_type n)

Description

No description yet.

Source

Lines 1843-1858 in include/EASTL/bitset.h. Line 378 in include/EASTL/bitset.h.

template <size_t N, typename WordType>
inline typename bitset<N, WordType>::this_type&
bitset<N, WordType>::operator<<=(size_type n)
{
    if(EASTL_LIKELY((intptr_t)n < (intptr_t)N))
    {
        EA_DISABLE_VC_WARNING(6313)
        base_type::operator<<=(n);
        if((N & kBitsPerWordMask) || (N == 0)) // If there are any high bits to clear... (If we didn't have this check, then the code below would do the wrong thing when N == 32.
            mWord[kWordCount - 1] &= ~(static_cast<word_type>(~static_cast<word_type>(0)) << (N & kBitsPerWordMask)); // This clears any high unused bits. We need to do this so that shift operations proceed correctly.
        EA_RESTORE_VC_WARNING()
    }
    else
        base_type::reset();
    return *this;
}





Add Discussion as Guest

Log in