News for hackers. Stuff that matters.
Re:Wait-free queueing and ultra-low latency logging by jzwinck on Thursday May 29, 2014 @08:16AM (#7815814)
It's unfortunate that literal strings in C++ cannot be programmatically distinguished from char* buffers. It would be useful if there were a separate type for literal strings which could implicitly decay to char* when needed. And functions should be able to return that type, because you may have "literal_string toString(MyEnum)" which always returns a literal string (or perhaps null).

Also, yes, Boost has some lock-free stuff now. It didn't back when the author was writing the code described.

Re:Wait-free queueing and ultra-low latency logging by humanrebar on Thursday May 29, 2014 @01:57PM (#7817597)
There are user-defined string literals (1) in C++11. They can do pretty much whatever you want.

Also, using templates it is trivial to distinguish between arrays of characters and character pointers.

Finally, there is a proposal for a string_view (2), which could be used to represent string literals, no copies needed.

(1) http://en.cppreference.com/w/cpp/language/user_literal (2) http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n360...

Re:Wait-free queueing and ultra-low latency logging by mortoray on Thursday May 29, 2014 @08:51AM (#7815948)
Yes, a string-literal type would be very helpful. In my Leaf language I have literal types. I think they offer some good optimiation abilities.