Is there a 128 bit integer in C++?

后端 未结 7 672
滥情空心
滥情空心 2020-12-01 11:41

I need to store a 128 bits long UUID in a variable. Is there a 128-bit datatype in C++? I do not need arithmetic operations, I just want to easily store and read the value v

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 12:25

    Checkout boost's implementation:

    #include 
    
    using namespace boost::multiprecision;
    
    int128_t v = 1;
    

    This is better than strings and arrays, especially if you need to do arithmetic operations with it.

提交回复
热议问题