basics

The standard way of converting between numbers and strings in C++11 -- Marius Bancila

Quick: Would you resort to stringstream? But that's so C++98... and so hard.

More people need to know about to_string and its cousins. Marius Bancila takes us for a short tour:

The standard way of converting between numbers and strings in C++11

by Marius Bancila

From the article:

C++11 provides several standard functions for converting numbers to strings and strings to numbers, all of them available in the <string> header.

For converting numbers to strings there are two new overloaded functions: to_string() and to_wstring(). They take one argument of various numeric types (int, long, long long, double, long double, etc.) and return either a std::string or a std::wstring with the number converted to text. ...

For the other way around of converting strings to numbers there are several overloaded methods (taking either a std::string or a std::wstring): ...

CppCon 2014 super early bird almost sold out -- ~20 tickets left

cppcon-144.PNGIf you've been thinking of registering for CppCon, you can save by doing it in the next couple of days. Over at CppCon.org, Boris Kolpackov reports:

Super Early Bird Last Chance

In the past couple of weeks a lot of C++ enthusiasts have registered for CppCon 2014 and as a result we only have about 20 super early bird entries left. If you are planning to attend, this is your last chance to register at the most affordable price.

After the limited Super Early Bird is full, Early Bird registration will be available until the end of June. Student registrations are also available at a heavily subsidized rate to ensure students can take advantage of the program.

See also the Call For Submissions to see the kinds of topics that you can expect to see covered.

 

Modern C++: What You Need to Know -- Herb Sutter

A recording of yesterday's //build/ talk by Herb Sutter is now available on Channel 9:

Modern C++: What You Need to Know

by Herb Sutter

This talk will give an update on recent progress and near-future directions for C++, both at Microsoft and across the industry. This is a great introduction to the current state of the language, including a glimpse into the future of general purpose, performance-intensive, power-friendly, powerful native programming.

From the advance description on Herb's blog:

I was asked to give a "foundational talk" about C++, and I decided that meant I should focus on addressing two questions that I get a lot these days:

  • FAQ #1 (1-2 slides): When should I use C++ compared to another language -- on all platforms in general, and on Microsoft platforms in particular?
  • FAQ #2 (lots of slides): What should I know about C++ if I’m a {Java|C#|JavaScript|Python|...} developer?

Even if you're a seasoned C++ developer, there are some nuggets and data points in the middle of the talk that I think you will find useful in your own work...

C++ in the 21st Century -- Arvid Norberg

A recently posted talk by BitTorrent's chief architect:

C++ in the 21st Century

by Arvid Norberg

From the announcement:

In this edition of Tech Talks: an overview of some C++ gems. I threw this talk together because my team was about to start a new project in C++11. Since it’s fairly new, I figured some of it might not be as well-known as it should. Fundamentally, I’m pretty excited about all the new possibilities in C++11. Even higher-level abstractions, at even lower cost than C++98.

In the video below, we go over for-loops, automatic type deduction, lambda functions and more.

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.

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.