TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

C++ 11 Approved

203 点作者 feydr将近 14 年前

7 条评论

Animus7将近 14 年前
Awesome! I've been looking forward to the day I'm no longer relying on "experimental" C++0x support! Here's a smaller tl;dr for those who want it:<p>-foreach loop<p>-first-class rvalue ("temporary") types<p>-lambda functions + closures<p>-implicit typing (auto keyword)<p>-decltype(), getting "declared type" of any expression<p>-variadic ... templates<p>-expanded STL -- incl. threading and RNG's<p>-construction from C-style initializer list<p>-Unicode literals<p>-enum class that doesn't auto-decay to int, enums with configurable base type<p>-explicit strong nullptr constant; no more NULL macro nonsense<p>The rest of the stuff is (in my opinion) less general/noteworthy.
评论 #2880735 未加载
评论 #2880684 未加载
评论 #2880474 未加载
评论 #2880643 未加载
评论 #2880877 未加载
malkia将近 14 年前
I wonder why the C++ body does not consider things like reflection/introspection more important than the stuff they came up with.<p>All that is needed is just an (optional, like RTTI) way to simply explain in binary format as part of the genereated binary information related to structures, types, functions, global variables, etc.<p>For example GUI in some external format (json, xml, do not matter) that has it's signals/actions/events encoded as simple names, where at runtime you can map them to actual C++ code (Objective C has it, Java I think, .NET, etc.)<p>This would reduce the time writing serializers, deserializers, and such. Make it optional (again like RTTI or exceptions) - but make it there for machines which can afford it (PC, Unix, OSX, and even mobile devices).<p>Why this is important? You would find 100+ libraries trying to solve this simple problem in plethora of weird ways - such as gcc-xml, OpenC++ parser, boost, etc, etc, etc.<p>And better preprocessor.
评论 #2880591 未加载
评论 #2881822 未加载
5hoom将近 14 年前
I say this is great news. A lot of the new stuff really does make C++ both nicer to use and a good deal safer, and it will be interesting to see more boost-y style of C++ become widespread.<p>Also glad they waited and went with C++ 11, and not C++0x which sounds like a l337 speak swearword.
评论 #2880653 未加载
评论 #2880679 未加载
huhtenberg将近 14 年前
So<p><pre><code> decltype </code></pre> instead<p><pre><code> typeof </code></pre> Damn... though not really surprising. To me this exemplifies C++ - it does reasonable things, but in that slightly ass-backwards way that makes it annoying... like a light switch that is installed upside down.
评论 #2881910 未加载
t413将近 14 年前
For those who are curious: <a href="http://en.wikipedia.org/wiki/C%2B%2B0x" rel="nofollow">http://en.wikipedia.org/wiki/C%2B%2B0x</a><p>Huge page though, needs a tl;dr of changes.
评论 #2880471 未加载
shuaib将近 14 年前
Waiting for TC++PL 4th Ed. now.
评论 #2880632 未加载
评论 #2881007 未加载
ilitirit将近 14 年前
When will we see compiler support?
评论 #2881885 未加载