Articles & Books

Declare functions noexcept wherever possible? -- Scott Meyers

Scott Meyers' work on his new "Effective C++" book, tentatively titled Effective Modern C++, progresses with an updated draft item:

Declare functions noexcept wherever possible?

by Scott Meyers

From the article:

In the comments following my last post, there was some controversy regarding the wording of my advice on noexcept functions. My advice is "Declare functions noexcept whenever possible." Some people appear to be concerned that this could be misconstrued as advocating noexcept even when it makes no sense, but I think the advice is a reasonable conclusion to the Item that supports it. I posted a draft version of that Item in early February, but I've revised the draft since then, and I'm making the current draft available now: ...









Control Structures in C++ -- Prashant Sharma

[For very new programmers, this is a basic review of the control flow language features available in C++ -- most of them also valid C, but at our request now with coverage also of the C++-specific range-for loop. -- Ed.]

Now on life`n`gadget:

Control Structures in C++ (Flow of Control)

by Prashant Sharma

From the article contents:

1 Control Structures in C++

1.1 Introduction

1.2 Selection Structure (Branching Statements)

1.2.1 if Statement

1.2.2 if-else Statement

1.2.3 Nested if else Statement

1.2.4  switch Statement

1.2.4.1 switch vs if-else

1.3 Looping Structure(Iterative Statements)

1.3.1 Elements of Looping Structure

1.3.2  for-loop

1.3.3 Range-for statement (range based for-loop) New C++11 Feature

1.3.4 while-loop

1.3.5 do-while loop

1.3.6 Related

C++ Status

A follow up on my proposal series & C++14 post:

C++ Status

by Jens Weller

From the Article:

This is the followup I promised after my last series for Issaquah. The current status of the standardization is that C++14 is on its final way to become a new ISO Standard, as you can see on the C++ Status Page of isocpp.org.

Quick Q: Is std::array movable any better than a plan C array? -- StackOverflow

Quick A: Yes.

Today on SO:

Move constructors and std::array

According to N3485 §23.3.2.2:

(...) the implicit move constructor and move assignment operator for array require that T be MoveConstructible or MoveAssignable, respectively.

So, std::array supports move semantics if the type of its elements does. Great!

However, what does this really mean? I tend to picture this type as a safer version of an array providing an STL-compliant interface but, if this is true, then how can an std::array move-construct its elements? Can I do the same with an ordinary array?

C++11/14 Standard & Standardization--Peter Sommerlad

Peter Sommerlad on C++11 and C++14 Standard(s) and Standardization:

Peter Sommerlad on C++11 and C++14 Standard(s) and Standardization

Created by Peter Sommerlad March 6, 2014

From the presentation:

Why is C++ in again?

• more computing per Watt!
  • mobile - battery powered
  • servers - cloud computing
  • high-performance computing & GPUs
• better abstractions than C
  • without performance price (e.g. of a VM)
  • embedded (higher-level type safety)
  • security (buffer overruns, pointers)

Slides (PDF)

Effective Modern C++ book status -- Scott Meyers

Scott Meyers' work on his new "Effective C++" book, tentatively titled Effective Modern C++, progresses with an updated draft table of contents and sample Item available:

Book Report: New Title, New TOC, New Sample Item

by Scott Meyers

Highlights from the article:

I recently finished the 32nd Item for the book, thus giving me drafts of five full chapters. The math still shows that about 40 Items will fit in the book's allotted 300 pages, so yesterday I took a hatchet to the prospective table of contents and chopped the number of Items down from 51 to 41. (Why 41? Because I have a feeling that one of the Items I've written will eventually get jettisoned as not being important enough to make the final cut.)  Here's the current draft TOC....

[Table of Contents -- read it, just the titles give useful guidance]

... The most recent Item I wrote was "Distinguish () and {} when creating objects." I blogged about one aspect of this topic here, and I thought you might be interested to see what I came up with. I've therefore made the current draft of this Item available, and I welcome your comments on it. Like almost all Items I've written, it's too long, so I'm especially interested in suggestions on how I can make it shorter, but I welcome all suggestions for improvement.

String's Length -- Andrzej KrzemieĊ„ski

Today from the desk of Andrzej:

String's Length

by Andrzej Krzemieński

From the article:

Let’s start with a small test. Is the invariant expressed with the following assertion correct?

void test_length(std::string const& s)
{
  assert(s.length() == strlen(s.c_str()));
}

It is not; otherwise I wouldn’t be mentioning this in the post; but do you know why it is wrong? ...

Looking at C++14

A few weeks ago the C++ committee did meet in Issaquah, its most important result: the final draft for C++14. See Herb Sutters trip report for details, I have written an overview based on his trip report, clangs C++14 status page and of course the papers it self.

Looking at C++14

by Jens Weller

From the Article:

As I have read through most papers of last and this year, a short overview which papers now have made it into the standard. So, what are the new features of C++14? Already before the last meeting, clang had implemented all known C++14 features of the draft published after the Chicago meeting.