Sunday, May 26, 2013

FeedaMail: Comments for Sutter’s Mill

feedamail.com Comments for Sutter's Mill

Comment on GotW #6a Solution: Const-Correctness, Part 1 by Herb Sutter

@Chris: Thanks. I figured that was implicit, but it can’t hurt to be explicit. I’ve rewritten the first part of #2 to make this clearer (I hope).

Read More »

Comment on Guru of the Week and the Exceptional C++ Series by C++ and Beyond: My material for December, and early-bird registration (through June 9) | Sutter's Mill

[…] we know C++14 really does complete C++11, and it’s compelling enough that it’s made me rewrite my Guru of the Week series and Exceptional C++ books, targeting C++14. From the […]

Read More »

Comment on C++ and Beyond: My material for December, and early-bird registration (through June 9) by nosenseetal

Scott’s content looks cool, your description sounds vague but as usual you are a good lecturer so I guess youll do a great job.
Also all this C++14 stuff – think you might want to tone it down because most ppl who know anything about C++ know C++14 is really really small improvement over C++11, so they might consider it pure PR. And some evil ppl like me:P may just get reminded how much they hate that committee did so amazingly little in 3y. I know Im gonna get downvoted but for those who disagree you might wanna read this: http://www.justsoftwaresolutions.co.uk/news/accu-2013-and-c++-standards-meeting.html
“The paper that did get approved ”
note value of nPapers in this. :)

Read More »

Comment on GotW #6a Solution: Const-Correctness, Part 1 by Michael Marcin

“Concurrent const operations on the same object are required to be safe without the calling code doing external synchronization.”

This is the sentence that was missing from the original you don’t know const and mutable video/discussion.
Everything makes sense now and this is a great feature of const.

Read More »

Comment on C++ and Beyond: My material for December, and early-bird registration (through June 9) by Nicol Bolas

> think you might want to tone it down because most ppl who know anything about C++ know C++14 is really really small improvement over C++11, so they might consider it pure PR.

… Huh? Return type deduction is “really really small”? Generic lambdas are “really really small”? Relaxed constexpr functions is “really really small”?

Were the changes few in number? Yes. Does that make them *small*? Absolutely not. These will fundamentally change how you code, much like `auto` and range-based for changed how you coded with C++11. These “quality of life” issues are important; they affect the lives of programmers on a daily basis.

Could more have been done? Absolutely. But in terms of having an effect on programmers and the language, these changes will unquestionably change how you write your code.

C++14 was never advertised as being something large. It was *always* stated to be more of a bugfix release, so it’s not like the committee over-promised (though the lack of a fix for uniform initialization is still highly annoying). So if you feel that it’s not big enough, that’s more your expectations than what was said to be in it.

> but for those who disagree you might wanna read this:

Maybe *you* should read the part where he said, “The meeting was 6 days long, but I was only able to attend for the first 2 days. Unsurprisingly, I spent my time in the Concurrency group (SG1).” In short, he *only* saw concurrency stuff.

The committee didn’t just add one concurrency paper; that’s just *all he saw*.

Read More »

Comment on C++ and Beyond: My material for December, and early-bird registration (through June 9) by Michael Golub

As part of C++14 style it would be really cool if you could take some examples and tutorials for popular C++ libraries and update them to C++14 style.

For example: in boost::asio there is a nice C++98 style usage example: http://www.boost.org/doc/libs/1_53_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp that can (hopefully) be converted to C++14 style. There are several handlers for connection and they pass dumb pointer to session data between them. Handlers can use lambdas instead of bind. Thanks to capture by move in lambdas dumb pointer can be replaced by lambda that captures unique_ptr. And sure there is much more to it.

I think there is some extra value in applying new style to practical old code examples rather than abstract examples.

Do conference participants receive training materials? If so under what conditions?

Read More »

Comment on C++ and Beyond: My material for December, and early-bird registration (through June 9) by nosenseetal

@Nicol
return type deduction for me looks like a small thing. :) Maybe it will look more important to me when I get exp.
polymorphic lambdas – nice , but I really wish committee made lambdas shorter to write, maybe by making _, _1 _2 _3 … “contextual keywords” inside lambda so squaring of range could be done with
std::transform…, []{return _*_; }); and more complicated stuff that takes more than 1 param could be done with
sort(, [](){return _1.total_msec() < _2.total_msec();} );

Also idk if it would be possible to have return keyword also optional, or it would be impossible to deduce if programmer meant void function that does something or nonvoid function that returns something.
And about C++14 being announced as a bug fix release – that doesnt make it less disappointing, just less surprising. I mean 3 y for few items.
But then again this is not something personal against Herb, for eg it makes me happy that he keeps the renaissance going by updating GotW… I really appreciate that. :)

Read More »

Comment on GotW #6b: Const-Correctness, Part 2 by muxecoid

At first glance:
Apparently operator+ modifies lhs which is not good. Adding const to lhs in function definition should cause it to fail to compile.
area should be mutable. calc_area can become const (and gets a lock at start of function body).
The overload of f that accepts const reference should not exist.
get_point obviously needs const.
In h it is the value of the pointer which is const, not the actual poly.

Read More »

Comment on C++ and Beyond: My material for December, and early-bird registration (through June 9) by Herb Sutter

@Michael: Yes, C&B attendees get PDF and printed handouts (you can opt out of the latter to save trees), for your own use and within your organization.

Read More »

Comment on C++ and Beyond: My material for December, and early-bird registration (through June 9) by Herb Sutter

@nosenseetal: In addition to the other comments, you should view it not just as “what’s in a published standard” but “what’s commercially available and real.” In that sense, C++11 (standard date) is “C++13″ in “real availability” since compilers are still catching up to C++11 and we hope that the first fully conforming C++11 implementation will be available sometime this year — Clang just became C+11 code-complete last month but that’s checking in code not testing and shipping, and GCC is close but also not shipping a fully conforming implementation yet. OTOH, we do expect to have one and possibly multiple fully conforming C++14 implementations at approximately the same time as C++14 itself is published. So you can view this as the standard and commercial reality syncing up.

After C++98 was published, it was five years before the first fully conforming shipping commercial implementation.

After C++11 shipped, it looks like it might be just two years before the first fully conforming shipping commercial implementation: Clang might release again just before the end of the year at their current cadence and if so should be largely conforming. But that’s probably the only one; GCC already did their normal annual spring release, and unless something changes they won’t be shipping a full implementation until next year’s spring release at earliest.

When C++14 ships, however, it looks like we’ll have at least one and possibly multiple conforming commercial implementations available roughly simultaneously, the same year.

Read More »

Comment on GotW #5 Solution: Overriding Virtual Functions by Fernando Pelliccioni

@Róbert Dávid:

“Meh”? Sorry, I am not native English speaker.

I know that. You didn’t need to explain. :)

I was just trying to simplify the code of Herb.

  auto pb = unique_ptr<Base>{ make_unique<Derived>() };  

Read More »
 
Delievered to you by Feedamail.
Unsubscribe

No comments:

Post a Comment