C

C++Next

cpp-next.com · Group blog · on HN since 2009

C++Next is a blog on modern C++ techniques, including performance, expression templates, concepts, and lessons from Elements of Programming.

What HN saysHN commenters link it most often for its pass-by-value article on copy elision and speed, and for its series on Elements of Programming.
21HN people shared it
6linked it in comments
18stories submitted
86story points
12 years agolast shared
2009people per year2026

Most-shared posts

  1. 1
    Want speed? Pass by value.
    6 people · 35 points · first shared 2009 · 30 comments on HN
  2. 2
    Having it all: Pythy syntax for C++
    3 people · 6 points · first shared 2011 · discussion on HN
  3. 3
    Expressive C++: Expression Optimization
    2 people · 4 points · first shared 2011 · discussion on HN
  4. 4
    A Breakthrough for Concepts in C++
    2 people · 3 points · first shared 2011 · discussion on HN
  5. 5
    C++Next
    1 people · 20 points · first shared 2009 · 9 comments on HN
  6. 6
    Expressive C++: Fun With Function Composition
    1 people · 5 points · first shared 2010 · discussion on HN
  7. 7
    Appearing and Disappearing consts in C++
    1 people · 3 points · first shared 2011 · discussion on HN
  8. 8
    Generic Functions and Function Objects « C++Next
    1 people · 2 points · first shared 2012 · discussion on HN
  9. 9
    Evil, or Just Misunderstood? « C++Next
    1 people · 2 points · first shared 2012 · discussion on HN
  10. 10
    To auto or not to auto?
    1 people · 2 points · first shared 2010 · discussion on HN
  11. 11
    Algebraic Data Types in C++
    1 people · 2 points · first shared 2012 · discussion on HN
  12. 12
  13. 13
    Using strings in C++ template metaprograms
    1 people · 1 points · first shared 2012 · discussion on HN
  14. 14
  15. 15
    Exceptionally moving
    1 people · first shared 2011

What HN people wrote when they linked it

alexchamberlain · 2012-01-12
This is slightly off topic, but a good read... http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/
stingraycharles · 2010-11-28
The book "Elements of Programming" is a good read, http://www.elementsofprogramming.com/, although it's a bit theoretical. While the book isn't free, this blog thoroughly covers the book and the lessons learned from it in a lecture series: http://cpp-next.com/archive/2009/11/%E2%80%9Celements-of-programming%E…
srean · 2014-05-09
It has not been mentioned in the original post or the comments yet, so here is a working prototype of a similar idea https://github.com/pfultz2/Pythy (for some specific value of working, you will need Clang) Its birth lies here Having it all: Pythy syntax for C++ [1]. It was a nice read. Unfortunately cpp-next seems to be down right now. Let me try to find it in Google's cache or internet archive. Here it is https://web.archive.org/web/20130820172127/http://cpp-next.com/archive… [1] http://cpp-next.com/archive/2011/11/having-it-all-pythy-syntax/
alexkcd · 2012-07-24
All modern C++ compilers support RVO, so there will be no copy given how this function is implemented. If by "safer" you mean "probably faster", then that's not true: http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/ The author's version is more idiomatic modern C++, while your version is something you'd write for a decade old compiler.
shin_lao · 2009-10-18
More information about copy elision here: http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/
obiterdictum · 2011-10-29
We have just started using some C++11 features, and with new features come new traps and potential complexities, as you'd expect with C++. A few examples: 1. Implicit lambdas ("[=]") capture "this" pointer for data members, if you capture a shared pointer and let the lambda object leave the scope, the shared pointer won't be copied (http://stackoverflow.com/q/7764564/23643), which may create unpleasant results, like code blowing up in your face. 2. Overuse of "auto" (not exclusive to C++) may make the code harder to read, especially if storing a result returned from a function. You can't tell if the return value is a smart pointer or a raw pointer, value or a reference, so you can't figure ownership semantics just by looking at the local code. 3. Move constructors/assignment operators are a bit of a black magic, especially with regard to suppressing default implementation (http://mmocny.wordpress.com/2010/12/09/implicit-move-wont-go) and exception safety (http://cpp-next.com/archive/2009/10/exceptionally-moving). I would refrain from using it, until I fully understand it. With that said, most of C++11 is a welcome change and makes C++ more pleasant to write, but, as always, you have to have your guard up and use new features judiciously.

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close