
I guess this thread was largely about communicating some things to Microsoft. I have an item to add to the list. I'm not sure of the terminology for this but it is supported in some of the newer versions of g++, but not in the version of VS 11 that I have. The code shown below is available here: http://webEbenezer.net/misc/direct.tar.bz2<http://webebenezer.net/misc/direct.tar.bz2>.
This snippet is from cmwAmbassador.cc #ifdef ENDIAN_BIG , byteOrder(most_significant_first) #else , byteOrder(least_significant_first) #endif
and this from cmwAmbassador.hh
#ifdef ENDIAN_BIG ::cmw::ReceiveBufferTCPCompressed<LeastSignificantFirst> cmwBuf; #else ::cmw::ReceiveBufferTCPCompressed<SameFormat> cmwBuf; #endif
uint8_t const byteOrder;
I want to rewrite that as the following in the .hh file.
#ifdef ENDIAN_BIG ::cmw::ReceiveBufferTCPCompressed<LeastSignificantFirst> cmwBuf; uint8_t const byteOrder = most_significant_first; #else ::cmw::ReceiveBufferTCPCompressed<SameFormat> cmwBuf; uint8_t const byteOrder = least_significant_first; #endif
and be able to get rid of the ifdef in the .cc file. Microsoft: please add support for this and let me know when it is available.
This looks like a use of non-static data member initializers, a C++11 feature. GCC support for this feature has been added in 4.7, and VC does not yet support it. This is one of the many C++11 features in which VC lags behind GCC (others are variadic templates, uniform initialization, delegating constructors, user-defined literals, and many others). I agree that it would be nice if MS got VC up to speed on C++11, but what does this have to do with the preprocessor? Regards, Nate