News

C++Now 2014: Student/Volunteer Program Accepting Applications

This year, we are again inviting students with an interest in C++ to attend the May 12-17, 2014 conference in Aspen, CO as Student/Volunteers. The program is an excellent way for students with any interest in C++ to learn about C++ and make lasting connections with the C++ community.

Student/Volunteer Program Now Accepting Applications

May 12 – 17, 2014

Aspen CO, USA

C++Now 2014 Conference Website

Quick Q: How do I write string literals that contain special characters? -- StackOverflow

so-blackjack.PNGQuick A: Use raw string literals! If your compiler doesn't have them yet, nag.

The original question on SO, but note the best answer is pepper_chico's rather than the selected answer:

Only Detect Text in Quotations (C++)

I'm not great at programming and recently started to read tutorials on C++.

I decided I would attempt to make a simple blackjack program. I tried to make a title with "big text" but C++ is preventing me from doing it because it is detecting other things inside the text.

    //Start Screen Begin
cout << " ____  _            _     _            _        ";
cout << "| __ )| | __ _  ___| | __(_) __ _  ___| | __    ";
cout << "|  _ \| |/ _` |/ __| |/ /| |/ _` |/ __| |/ /    ";
cout << "| |_) | | (_| | (__|   < | | (_| | (__|   <     ";
cout << "|____/|_|\__,_|\___|_|\_\/ |\__,_|\___|_|\_\    ";
cout << "                       |__/                     ";
    //Start Screen End

This is what I am trying to display, yet keep getting the following error:

undefined reference to 'WinMain@16'

I am asking if there is a way to tell C++ I only want it to read and display the text, and not use any functions.

C++ in 2014 -- Jens Weller

From new C++ user groups springing up across Europe and upcoming conferences, to the Boost refactoring and (of course) C++14, Jens Weller has a nice piece previewing some of the things to look forward to for C++ in 2014.

C++ in 2014

by Jens Weller

Note that Jens' list is not complete, but it gives a pretty good overview of what's coming up in the near term with a few more things to be added later.

A small teaser from the article:

I already know that there are new C++ User Groups in Aachen, Dortmund, Heidelberg and Munich in Germany, also a Russian C++ User Group is now meeting in St. Petersburg and Moscow. I think a few others will follow...

 

Quick Q: Should "property get" functions be noexcept? -- StackOverflow

Quick A: Maybe, but it generally commits you to exposing the internal type (can't change representation).

Recently on SO:

Should I use noexcept for getters always?

Should I use noexcept method modifier for getters always in C++11?

I mean simple getters here that just return members. At least in all my getters I have here an exception can't possibly be thrown. One downside is that a getter gets too verbose:

const std::string& getName() const noexcept{ return name; }

The good side as pointed out in Stroustrup's book is that the compiler might do some optimizations here and there.

Two Full Days of C++11 for C++ Programmers -- Michael Caisse & Jon Kalb (Mar 25-26, San Francisco)

codestarssummit14.PNGMichael Caisse and Jon Kalb will be conducting a two-day training class on C++11 in San Francisco in March as part of the Code Stars Summit event.

Two Full Days of C++11 for C++ Programmers

Instructors: Michael Caisse and Jon Kalb

March 25-26

San Francisco, CA, USA

From the announcement:

C++11 introduces a lot of new tools for writing code that is expressive, but continues the C++ tradition of uncompromised performance. If you are comfortable with C++, but need to get up to speed with the language and library extensions offered by C++11 this is your opportunity to learn the latest in C++ from some of the best instructors available.

Topics covered include:

  • Move semantics, rvalues, and perfect forwarding
  • Lambda expessions
  • New smart pointers
  • Tuples
  • Range-based for loops
  • Variadic templates
  • Standard function and bind
  • auto and decltype
  • Initializer lists
  • Uniform initialiation
  • constexpr
  • Delegating constructors
  • Defaulted and deleted member functions
  • explicit and final
  • nullptr

Prerequisites:

No knowledge of C++11 is assumed, but basic familiarity with C++ is assumed. It isn’t necessary that students be able to write templates or operator overloads unassisted, but they need to be able to follow examples of such code, or they are likely to fall behind.

GotW #95 Solution: Thread Safety and Synchronization -- Herb Sutter

The solution to the latest GotW problem is now available:

GotW #95 Solution: Thread Safety and Synchronization

by Herb Sutter

From the article:

This GotW was written to answer a set of related frequently asked questions. So here’s a mini-FAQ on "thread safety and synchronization in a nutshell," and the points we’ll cover apply to thread safety and synchronization in pretty much any mainstream language.

ACCU 2014 conference schedule posted (April 8-12)

accu-2014.PNG

Conference chair Jon Jagger has published the conference schedule and session abstracts for ACCU 2014.

ACCU 2014 Conference Schedule

Follow conference news via @accu2014 on Twitter.

Some highlights of this year's schedule include a number of C++ talks. Most of the following speakers are ISO C++ committee members:

Switching to C++11 and C++14 in One Day (Nico Josuttis)

C++14 -- An Overview of the New Standard for C++(11) Programmers (Peter Sommerlad)

There Ain't No Such Thing As a Universal Reference (Jonathan Wakely)

The C++14 Standard Library (Jonathan Wakely)

C++ Dynamic Performance (Aleksandar Fabijanic)

C++ Undefined Behavior -- What Is It, and Why Should I Care? (Marshall Clow)

Large-Scale C++ -- Advanced Levelization Techniques (John Lakos)

C++ Pub Quiz (Olve Maudal)

Creating Safe Multi-Threaded Applications in C++11 (Jos van Eijndhoven)

Random Number Generation in C++ -- Present and Potential Future (Pattabi Raman)

Range and Elevation -- C++ In a Modern World (Steve Love)

Generic Programming with Concepts Lite (Andrew Sutton)

Where Is C++ Headed? (Hubert Matthews)

Complementary Visions: Integrating C++ and Python with Boost.Python (Austin Bingham)

The Continuing Future of C++ Concurrency (Anthony Williams)

Polymorphic Allocators for Fundamental Libraries (Alisdair Meredith)

Executors for C++ (Detlef Vollmann)

Endnote: Everything You Ever Wanted To Know About Move Semantics (and then some) (Howard Hinnant)

Using Regular Expressions with Modern C++ -- Kenny Kerr

dn519920.kenny_kerr_headshot(en-us,MSDN.10).jpgIn the current MSDN Magazine:

Using Regular Expressions with Modern C++

by Kenny Kerr

From the article:

C++11 introduced a long list of features that are in themselves quite exciting, but if all you see is a list of isolated features, then you’re missing out. The combination of these features makes C++ into the powerhouse that many have grown to appreciate. I’m going to illustrate this point by showing you how to use regular expressions with modern C++... the combination of C++ language and library features really turns C++ into a productive programming language.

Quick Q: How can I avoid writing ::value and ::type when using std::enable_if? -- StackOverflow

Quick A: Use a template alias. Several standard ones are coming in C++14.

Recently on SO:

How can I avoid writing ::value and ::type when using std::enable_if? [cppx]

In some of my code, namely the header rfc/cppx/text/String.h, I found the following mysterious snippet:

template< class S, class enable = CPPX_IF_( Is_a_< String, S > ) >
void operator!  ( S const& )
{ string_detail::Meaningless::operation(); }

The operator! is in support of a String class that has an implicit conversion to raw pointer. So I overload (among others) operator! for this class and derived classes, so that inadvertent use of a non-supported operator will give a suitable compilation error, mentioning that it's meaningless and inaccessible. Which I think is much preferable to such usage being silently accepted with an unexpected, incorrect result.

The CPPX_IF_ macro supports Visual C++ 12.0 (2013) and earlier, which finds C++11 using to be mostly beyond its ken. For a more standard-conforming compiler I would have written just ...

template< class S, class enable = If_< Is_a_< String, S > > >
void operator!  ( S const& )
{ string_detail::Meaningless::operation(); }

This looks like std::enable_if,

template< class S, class enabled = typename std::enable_if< Is_a_< String, S >::value, void >::type >
void operator!  ( S const& )
{ string_detail::Meaningless::operation(); }

except that the If_ or CPPX_IF_, and its expression, is much more concise and readable.

How on Earth did I do that?