September 2014

Introduction to Type Traits in the C++ standard library -- Yvonne Ma

"Are you an enum?" "Are you polymorphic?" The answers to these type questions and more are already in your C++11 standard library:

Introduction to Type Traits in the C++ standard library

by Yvonne Ma

From the article:

... As its name suggests, Type Traits exposes different characteristics of types, or simply the “type of type”. In many C++ programming practices, especially these in template metaprogramming, developers may find it difficult to build a template work for all types without knowing the characteristics of a type. That’s the key reason for the emergence of Type Trait...

C++ Templates series -- Feabhas

Here's a recent series that just got a new instalment today: It introduces template basics in a nicely explained and accessible way suitable for a gentle introduction, and then going on to progressively help the reader develop stronger template muscles.

C++ Templates series

by Feabhas

An Introduction to C++ Templates

Template Classes

Template Inheritance

Templates and Polymorphism

Template Member Functions

Variadic Templates

Templates of Templates

And today: Template Specialization

From the Introduction:

Templates are a very powerful -- but often very confusing -- mechanism within C++. However, approached in stages, templates can be readily understood (despite their heinous syntax).

The aim of this series of articles is to guide beginners through the syntax and semantics of the foundation concepts in C++ template programming.

atoi and itoa conversions in C++11 -- FangLu

All your friends know about C++11's new stoi and to_string, right? If not, here's a quick refresher to share:

atoi and itoa conversions in C++11

by FangLu

The key reminder from the article:

... The atoi and itoa conversions in C are not very satisfying to programmers, because programmers need to deal with invalid input and exceptions to avoid worst case. On the other hand, these functions are straightforward and easy to use. So they are not rare in C++ code...

In C++11, global functions, such as std::to_string, std::stoi/stol/stoll are introduced to implement atoi/itoa conversions conveniently. For example:

string s;

s += to_string(12) + " is int, ";

s += to_string(3.14f) + " is float.";

cout << s << endl;

where to_string can do type conversion according to the parameter type.

Here is another example:

string s("12");

int i = stoi(s);

cout << i << endl;

Fun with Lambdas: C++14 Style (Part 3) -- Sumant Tambe

sumant-tambe.PNGMore rapid-fire "now write this using lambdas" problem-solution drill with Sumant Tambe:

Fun with Lambdas: C++14 Style (Part 3)

by Sumant Tambe

From the article:

Now that we have C++14, it has opened up doors for truly mind-bending uses of lambdas--more specifically--generic lambdas. This blog post is the third installment in the series of "Fun with Lambdas: C++14 Style". Check out part 1 and part 2 if you have not already.

This post is about "monadic tuples"...

CppCon: Call for Lightning Talks, Take 2 -- Boris Kolpackov

CppCon minus one week:

Call for Lightning Talks, Take 2

by Boris Kolpackov

From the announcement:

As part of getting ready to come to CppCon 2014, please consider presenting a Lightning Talk. All attendees (as well as anyone nearby who is taking advantage of the free evening content without registering) are eligible to present a 5 or 15 minute session on Tuesday evening. While the first Call for Lightning Talks has more details on what we’re looking for, we’re open to talks from new speakers, from experienced speakers, from those who work mainly in another language and are visiting C++, from those who work in C++ all the time -- everyone! If there’s one tool you just love using, one technique or best practice you’d like to share with others, or one thing you think is pretty darn funny, please see if you can make it into a 5 or 15 minute talk and share it Tuesday evening. There will be a projector and there will be an audience so why not “give it a go” and see what happens?

We’ll be selecting the 8 sessions on Monday, Day 1 of the conference. Just email open-content@cppcon.org and tell us what you want to talk about, what length you need and a little bit about yourself -- one sentence is fine. Your topic should be relevant to CppCon attendees but doesn’t need to be about C++ -- we’d love to see “Why C++ developers should also know [language]” for example. Even if you don’t plan to submit, plan to attend, it’s sure to be fun!
 

C++ User Group Meetings in September

This time for September - the monthly overview on C++ User Group Meetings:

C++ User Group Meetings in September

by Jens Weller

From the article:

The monthly overview over the upcoming C++ User Group Meetings. This time a few new user groups meet, and as summer comes to an end more meetings might get scheduled in the next days. But due to me going to CppCon, I have to post this a bit earlier then usual.

The list of upcoming meetings:

    3.9 C++ UG London - Cross Platform Games: iOS to Android
    10.9 C++ UG San Francisco/ Bay area - Presentation and Q&A
    11.9 C++ UG Dresden
    15.9 C++ UG NRW/Dortmund
    17.9 C++ UG Düsseldorf - Treffen der C++ User Gruppe NRW
    17.9 C++ UG Hamburg - Praktische Übersicht über Valgrind
    17.9 C++ UG Seattle/northwest - Parallelism in the Standard C++: What to Expect in C++ 17
    20.9 C++ UG Pune, India - C++ and Boost Pune first meetup
    23.9 C++ UG Chicago - See you in September
    24.9 C++ UG San Francisco/ Bay area - Workshop and Discussion Group
    25.9 C++ UG Rhein-Neckar - September Meeting
    25.9 C++ UG London
    26.9 C++ UG Istanbul
    2.10 C++ UG Paris - C++ & Python