Function to_uint32

Synopsis

#include <include/EASTL/bitset.h>

uint32_t to_uint32() const

Description

No description yet.

Source

Lines 924-942 in include/EASTL/bitset.h. Line 135 in include/EASTL/bitset.h.

template <size_t NW, typename WordType>
inline uint32_t BitsetBase<NW, WordType>::to_uint32() const
{
    #if EASTL_EXCEPTIONS_ENABLED
        // Verify that high words or bits are not set and thus that to_uint32 doesn't lose information.
        for(size_t i = 1; i < NW; ++i)
        {
            if(mWord[i])
                throw std::overflow_error("BitsetBase::to_uint32");
        }

        #if(EA_PLATFORM_WORD_SIZE > 4) // if we have 64 bit words...
            if(mWord[0] >> 32)
                throw std::overflow_error("BitsetBase::to_uint32");
        #endif
    #endif
    return (uint32_t)mWord[0];
}





Add Discussion as Guest

Log in