Re: C++ and D bool compatibility

2013-05-02 Thread Jeremy DeHaan
On Friday, 3 May 2013 at 01:03:39 UTC, bearophile wrote: Jeremy DeHaan: D bools are 1 byte, and C/C++ chars are 1 byte as well and it works. D bools are 1 byte, but C chars don't need to be 1 byte, so you are working with an implementation detail. Technically speaking, you are right. Gener

Re: C++ and D bool compatibility

2013-05-02 Thread bearophile
Jeremy DeHaan: D bools are 1 byte, and C/C++ chars are 1 byte as well and it works. D bools are 1 byte, but C chars don't need to be 1 byte, so you are working with an implementation detail. I think in C99+ it's better to use uint8_t from stdint.h, that's safely always 1 byte long. Bye,

Re: C++ and D bool compatibility

2013-05-02 Thread Jeremy DeHaan
On Saturday, 27 April 2013 at 23:38:17 UTC, bearophile wrote: Jeremy DeHaan: I was reading this: http://dlang.org/cpp_interface.html And it mentions the various types and their compatibility with one another, but it leaves out bools. It would be very useful for me if it works out like this,

Re: C++ and D bool compatibility

2013-04-27 Thread bearophile
Jeremy DeHaan: I was reading this: http://dlang.org/cpp_interface.html And it mentions the various types and their compatibility with one another, but it leaves out bools. It would be very useful for me if it works out like this, but does anyone know off the top of their heads/tried it befor

C++ and D bool compatibility

2013-04-27 Thread Jeremy DeHaan
Hey guys! I was reading this: http://dlang.org/cpp_interface.html And it mentions the various types and their compatibility with one another, but it leaves out bools. It would be very useful for me if it works out like this, but does anyone know off the top of their heads/tried it before?