Is there 'byte' data type in C++?

后端 未结 8 569
耶瑟儿~
耶瑟儿~ 2020-12-04 14:33

If exists is there header file to include?

This code give compilation error:

#include 

using namespace std;

int main()
{
    byte b         


        
8条回答
  •  醉话见心
    2020-12-04 14:59

    namespace std
    {
      // define std::byte
      enum class byte : unsigned char {};
    
    };
    

    This if your C++ version does not have std::byte will define a byte type in namespace std. Normally you don't want to add things to std, but in this case it is a standard thing that is missing.

    std::byte from the STL does much more operations.

提交回复
热议问题