(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=43449669

Hacker News 上的一个帖子讨论了一篇关于 C++26 高级技巧的博客文章。评论者们对代码表示困惑,称其像外星语言一样,感觉更像是一种“人工语言”(conlang),而不是标准 C++。评论中特别提到了“auto 模板”、“std::meta”、“[:Member:]”、“nonstatic_data_members_of”、“std::is_void_v”以及复杂的 lambda 表达式,认为这些是导致代码难以理解的原因。一位评论者特别指出“using ret_t = first_non_void())...>;”这一行代码尤其令人难以招架。总的来说,虽然评论者认为作者可能拥有深厚的 C++ 知识,但代码对于普通的 C++ 程序员来说是难以理解和陌生的。

相关文章
  • (评论) 2025-03-25
  • (评论) 2024-07-06
  • (评论) 2024-04-20
  • C++26 扩展技巧 2025-03-26
  • (评论) 2024-09-15

  • 原文
    Hacker News new | past | comments | ask | show | jobs | submit login
    C++26 Expansion Tricks (pydong.org)
    7 points by HeliumHydride 3 hours ago | hide | past | favorite | 2 comments










    I look at C++ code like this and feel like it's from a different planet. These are keywords and approaches I just never use myself. Templates ocassionally, but auto templates? std::meta? Whatever [:Member:] is? nonstatic_data_members_of? std::is_void_v? Plus the lambdas make this syntax even worse.

    It feels like I'm looking at a conlang instead of C++.

    Not hating the author, I'm sure they know their stuff and this is useful to someone. Just looking at this from the perspective of an ordinary C++ programmer, it looks very alien.



    Yeah look at this eye watering line:

        using ret_t = first_non_void())...>;






    Join us for AI Startup School this June 16-17 in San Francisco!


    Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact



    Search:
    联系我们 contact @ memedata.com