7 ms·
something similar was initiated by herb-sutter as well in his 'guru of the week' (gotw) columns. which then became books in their own right aka 'exceptional c++
by signa11 9y ago
something similar was initiated by herb-sutter as well in his 'guru of the week' (gotw) columns. which then became books in their own right aka 'exceptional c++' series.
are these tips more 'modernish' ?
- fauigerzigerk 9y agoBoth series have been created over many years, so I'm not sure which one is more modern. Herb Sutter says that all GotW articles are being revised to reflect changes in C++14.
- SwellJoe 9y agoTip #1 covers a feature found in C++17, so I'd say yes.
- jzwinck 9y agoTip #1 appears on the surface to be about C++17's std::string_view, but many shops had something similar to string_view for a decade or more before C++ made it official. The tips are not presented in their original form; edits have been made (as per the linked page). I think Google had something like string_view by 2009 at the latest, using C++03 compilers.
- humanrebar 9y agoLinks to illustrate: https://github.com/boostorg/utility/blob/develop/include/boost/utility/string_ref.hpp https://github.com/boostorg/utility/blob/develop/include/boo... This proposal references Google and LLVM implementations: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3442.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n344... Looks like the LLVM implementation goes back to at least 2009: https://github.com/llvm-mirror/llvm/blob/master/include/llvm/ADT/StringRef.h https://github.com/llvm-mirror/llvm/blob/master/include/llvm...
- dogruck 9y agoYeah, discussing the origins of string_view is like talking about who invented base-two numbering. :-)
- humanrebar 9y agoYes. It is a small step from the well-worn convention to pass each char* around with its length.
- signa11 9y ago> Yes. It is a small step from the well-worn convention to pass each char* around with its length. kind of surprising to note that implicit 'string_view' conversions are now regarded as a good thing? on a side note, the language is _complicated_, and shows no signs of stopping ! 3 articles on move/copy ctor's and only one that applies to programming in general.
- fooker 9y ago>I think Google had something like string_view by 2009 at the latest, using C++03 compilers. Yeah, StringPiece http://google.github.io/google-api-cpp-client/latest/doxygen/stringpiece_8h_source.html http://google.github.io/google-api-cpp-client/latest/doxygen...
- apaprocki 9y agoHere's Bloomberg's version: https://bloomberg.github.io/bde/group__bslstl__stringref.html https://bloomberg.github.io/bde/group__bslstl__stringref.htm...
- TwoBit 9y agoEASTL had it at least as early as 2005.
- ksherlock 9y agoAnd they also claim string_views can be constructed from a std::string. That's true of their implementation and it's true of the TS string_view but it was removed from the c++17 string_view.
- stochastic_monk 9y agoHerb Sutter's recent tips are more modern (and the backlog is being updated). Scott Meyers' Effective Modern C++ is a great successor to his Effective C++ book which spawned the whole "Effective *" snowclone books and covers C++14, though not 17, of course. Actually, this blog post's content looks like a watered-down version of a tip from either or both of the above authors, though I'm too lazy to chase down a verification.