Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    C

    C++ Truths

    cpptruths.blogspot.com · Personal blog · on HN since 2012

    Technical blog on C++ covering lambdas, templates, metaprogramming, constexpr, and type system features like variant and variance.

    Visit blogHN submissions
    Languages & CompilersProgramming
    What HN says

    HN commenters praise its C++14 lambda series and cite it for constexpr and the Turing-completeness of templates.

    Stats for nerds
    17HN people shared it
    11linked in comments
    54story points
    May 2016last shared
    2012people per year2016

    Top posts on HN

    1. 1
      Covariance and Contravariance in C++ Standard Library
      1 person · 36 points · first shared 2015 · 4 comments on HN
    2. 2
      Fun with Lambdas: C++14 Style
      1 person · 4 points · first shared 2016 · 1 comments on HN
    3. 3
      Fun with Lambdas: C++14 Style (part 2)
      1 person · 3 points · first shared 2014 · Discussion on HN
    4. 4
      Inheritance vs. std::variant in C++
      2 people · 2 points · first shared 2018 · Discussion on HN
    5. 5
      Dependently-typed Curried printf
      1 person · 2 points · first shared 2016 · Discussion on HN
    6. 6
      Fun with Lambdas: C++14 Style (Part 4)
      1 person · 2 points · first shared 2015 · Discussion on HN
    7. 7
      Using The Pigeonhole Principle in C++ Metaprogramming
      1 person · 2 points · first shared 2014 · Discussion on HN
    8. 8
      C++ Truths: Fun with Lambdas: C++14 Style (part 3)
      1 person · 1 points · first shared 2014 · Discussion on HN
    9. 9
      Functional programming first principles in C++14
      1 person · 1 points · first shared 2014 · Discussion on HN
    10. 10
      Unit Testing C++ Templates and Mock Injection Using Traits
      1 person · 1 points · first shared 2019 · Discussion on HN

    What HN people wrote when they linked it

    • pyroisOct 2014

      It's very heartening to see Microsoft and Intel actually adopting the new C++ standards given the fiasco that compiler support for C and C++ standards has been in the past.

      That said, I sort of worry about the new approach to C++ standards. It was nearly a decade between C++03 and C++11 (duh) and C++03 was a very minor set of changes compared to C++98. Now we are planning to have major changes every six years, with a minor release in between? That's a new standard every three years. It seems hard to imagine how the compiler developers are going to keep up with that, much less our libraries.

      Considering the C++ world is already very fragmented in terms of style and features used (C with Classes, Modern C++, horrible in-between?), I don't know if C++17 is going to be good for the ecosystem. I mean, people are talking about adding everything from monads[0] to compile-time reflection[1].

      If the designers were willing or able to remove features (do we really need two different initialization syntaxes?) then I would be less concerned, but intentionally breaking every existing C++ library would probably do more harm than good.

      Overall, I'm just not sure that this aggressive schedule of adding new features to a large language is a great idea.

      [0] http://bartoszmilewski.com/2014/02/26/c17-i-see-a-monad-in-your-future/
      [1] http://cpptruths.blogspot.com/2014/03/why-we-need-compile-time-reflection-in.html

    • ameliusNov 2014

      Here is a personal anecdote.

      I recently tried to make a lambda function in C++ call itself.
      My first approach didn't work, because the variables were captured by reference, causing my program to crash (the enclosing scope had disappeared when my recursive lambda function was called). I easily tracked down that problem. But this generated a second problem: without using "capturing by reference", I couldn't make the lambda function refer to itself!

      Of course, I looked around on the internet, and I found [1], which actually shows the insane amount of hacking required to make a lambda function call itself. And in the end, this solution didn't even work for me.

      So, concluding, I think we're a long way from "functional programming in C++".

      [1] http://cpptruths.blogspot.nl/2013/10/creating-recursive-lambdas-and.html

    • vinayan3May 2012

      I agree. It depends on what subset of C and C++ is used. If macros are used the only way to actually verify the code will be to pre-process it. Worse is if templates are used. Some templates don't even finish compiling.

      http://cpptruths.blogspot.com/2005/11/c-templates-are-turing-complete.html

      Most likely no one will write such a template in a mission critical system. However, from a formal verification standpoint the only way to verify the code is to check the binaries.

    • kruhftMay 2013

      This is my first exposure to constexpr and it looks very interesting. According to this article it's a second C++ metaprogramming language: http://cpptruths.blogspot.ca/2011/07/want-speed-use-constexpr-meta.html.

      The more I learn about C++11 the more I like it. There's some really amazing new features that I've only seen in Lisps, plus there's full static typing, which is the one thing I miss from Lisps.

    • pjc50May 2016

      C++ templates are also turing complete, executed at compile time, and can result in extremely high compile times: http://cpptruths.blogspot.co.uk/2005/11/c-templates-are-turing-complete.html

      I don't think that failure to terminate compiles is too big a problem in practice; treat it as just another form of compile-time error and fix your program.

    • zemNov 2012

      wow, did not know about -Weffc++. quite impressive that they added that flag. here's a blog post if anyone else wants to read about it:

      http://cpptruths.blogspot.com/2006/08/g-compiler-option-weffc.html

    Related

    Herb Sutterherbsutter.com204 people

    Bjarne Stroustrup on Dennis Ritchie: They said it couldn't be done, & he did it

    Herb Sutter
    Personal · last shared 2026
    PVS-Studio Blogviva64.com135 people

    Criticizing the Rust Language, and Why C/C++ Will Never Die

    PVS-Studio Blog
    Company · last shared 2021
    Scott Meyersscottmeyers.blogspot.com43 people

    } // good to go

    Scott Meyers
    Personal · last shared 2025
    Victor Zverovichzverovich.net20 people

    Giving up on Julia

    Victor Zverovich
    Personal · last shared 2023
    Axel Wagnerblog.merovius.de29 people

    Diminishing returns of static typing

    Axel Wagner
    Personal · last shared 2025
    Fluent C++fluentcpp.com66 people

    Technical Debt Is Like a Tetris Game

    Fluent C++
    Personal · last shared 2025
    C++ Storiescppstories.com35 people

    Embracing Modern C++ Safely, Book Review

    C++ Stories
    Personal · last shared 2026
    Bluish Coderbluishcoder.co.nz77 people

    Using Freenet

    Bluish Coder
    Personal · last shared 2025