C++ 17 implements std::byte so if I do "using namespace std" it clashes with the byte typedef in MachineInterface.h and I get all kinds of compiler errors.
Is there any way to fix this that doesn't involve me prefixing every one of the bazillion strings/vectors/maps/sets and god knows what else in my project with "std::"?
C++ 17 and byte
Re: C++ 17 and byte
You can comment out 'typedef unsigned char byte' in MachineInterface.h, #include <cstddef> and change references to byte to std::byte in the file.
Or if you don't want to modify the file you can do
and use Buzz::CMachineInterface etc.
Or if you don't want to modify the file you can do
Code: Select all
namespace Buzz
{
#include "MachineInteface.h"
}
Re: C++ 17 and byte
Thanks Oskari. One question though, std::byte is an enum class (which is still a new thing for me ) so is that compatible with the simple unsigned char byte that we know and love?oskari wrote: ↑Mon Nov 09, 2020 7:39 am You can comment out 'typedef unsigned char byte' in MachineInterface.h, #include <cstddef> and change references to byte to std::byte in the file.
Or if you don't want to modify the file you can do
and use Buzz::CMachineInterface etc.Code: Select all
namespace Buzz { #include "MachineInteface.h" }