Function to_uint64

Synopsis

#include <include/EASTL/bitset.h>

uint64_t to_uint64() const

Description

No description yet.

Source

Lines 945-965 in include/EASTL/bitset.h. Line 136 in include/EASTL/bitset.h.

template <size_t NW, typename WordType>
inline uint64_t BitsetBase<NW, WordType>::to_uint64() const
{
    #if EASTL_EXCEPTIONS_ENABLED
        // Verify that high words are not set and thus that to_uint64 doesn't lose information.

        EASTL_CT_ASSERT(NW > 2); // We can assume this because we have specializations of BitsetBase for <1> and <2>.
        for(size_t i = 2; i < NW; ++i)
        {
            if(mWord[i])
                throw std::overflow_error("BitsetBase::to_uint64");
        }
    #endif
    #if(EA_PLATFORM_WORD_SIZE == 4)
        EASTL_CT_ASSERT(NW > 2); // We can assume this because we have specializations of BitsetBase for <1> and <2>.
        return (mWord[1] << 32) | mWord[0];
    #else
        return (uint64_t)mWord[0];
    #endif
}





Add Discussion as Guest

Log in