I'd like to use C++17's std::byte
type if it's available, and fall back to using unsigned char
if not, i.e. something along the lines of
#include <cstddef>
namespace my {
#if SOMETHING
using byte = std::byte;
#else
using byte = unsigned char;
#endif
}
Unfortunately it seems that std::byte
didn't come come with the usual feature test macro, so it's not obvious what SOMETHING
above should be. (AFAIK the value of __cplusplus
for '17 hasn't been set yet, so I can't test for that either.)
So, does anybody know of a way to detect whether std::byte
is available on the big three compilers?