Functional Programming in C++ -- John Carmack

In case you missed it:

Functional Programming in C++

by John Carmack

From the article:

... My pragmatic summary: A large fraction of the flaws in software development are due to programmers not fully understanding all the possible states their code may execute in. In a multithreaded environment, the lack of understanding and the resulting problems are greatly amplified, almost to the point of panic if you are paying attention. Programming in a functional style makes the state presented to your code explicit, which makes it much easier to reason about, and, in a completely pure system, makes thread race conditions impossible.

I do believe that there is real value in pursuing functional programming, but it would be irresponsible to exhort everyone to abandon their C++ compilers and start coding in Lisp, Haskell, or, to be blunt, any other fringe language...

N4307, N4308: National body PDTS ballot comments on Library Fundamentals TS and Parallelism TS

New WG21 papers are available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

N4307: National Body Comments, ISO/IEC PDTS 19568, Technical Specification: C++ Extensions for Library Fundamentals (Barry Hedquist)

N4308: National Body Comments, ISO/IEC PDTS 19570, Technical Specification: C++ Extensions for Parallelism (Barry Hedquist)

 

Quick Q: What type do lambdas get compiled into? -- StackOverflow

Quick A: A compiler-generated type that stores the captured variables in its data members, and exposes the function signature and body as its operator().

Recently on SO:

What type do lambdas get compiled into?

As I know all data types must be known at compile time, and lambda is not a type. Does lambda got translated into anonymous struct with operator() or std::function wrapped?

For example,

std::for_each(v.begin(), v.end(), [](int n&){n++;});

Tiny Metaprogramming Library -- Eric Niebler

eric-niebler-toronto.PNGWe like to link to articles at all levels. This one's near the top of the scale, for those looking for a real challenge:

Tiny Metaprogramming Library

by Eric Niebler

As the intro says [emphasis ours]:

(Difficult-to-grok metaprogramming below. Not for the faint of heart.)

From the rest of the introduction:

At the recent Urbana-Champaign meeting of the C++ Standardization Committee, Bill Seymour presented his paper N4115: Searching for Types in Parameter Packs which, as its name suggests, describes a library facility for, uh, searching for a type in a parameter pack, among other things. It suggests a template called packer to hold a parameter pack:

// A class template that just holds a parameter pack:
template <class... T> struct packer { };

Many of you are probably already familiar with such a facility, but under a different name:

// A class template that is just a list of types:
template <class... T> struct typelist { };

It became clear in the discussion about N4115 that C++ needs a standard typelist template and some utilities for manipulating them. But what utilities, exactly? ...

Visual Studio 2015 Preview announced, includes Clang/LLVM support for Android, iOS

This morning, Microsoft announced Visual Studio 2015 Preview. It contains continued C++11/14 conformance improvements in the traditional Visual C++ compiler, and also adds direct support for the Clang/LLVM compiler toolchain to build C++ code for Android now and iOS in the near future.

Cross-Platform Mobile Development with Visual C++

by Ankit Asthana

From the announcement:

Modern application customers are demanding applications be available for multiple device platforms (such as Windows, Android and iOS).... C++ is unique as it provides the ability to write efficient, fast and feature rich cross-platform mobile code once which can then be shared across these different device platforms.

Visual Studio 2015 Preview introduces support for developers to be able to build cross-platform mobile native (C/C++) binaries targeting Windows platforms (through the Visual C++ toolchain C1xx/C2) and the Android platform (through Clang/llvm)...

What makes Clang so special? -- CoderGears

Today on CoderGears:

What makes Clang so special?

by CoderGears Team

From the article:

It’s proven that Clang is a mature compiler for C and C++ as [are the] GCC and Microsoft compilers, but what makes it special is the fact that it’s not just a compiler. It’s also an infrastructure to build tools. Thanks to its library based architecture which makes the reuse and integration of functionality provided more flexible and easier to integrate into other projects...

N4257, N4273, N4282: New papers adopted for Library Fundamentals 2 TS

Note: The following new papers (among other already-posted ones) were approved on Saturday at the end of last week's ISO C++ meeting for the Library Fundamentals "2" Technical Specification

New WG21 papers are available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

N4257: Delimited iterators (Mike Spertus, Nathan Wilson)

N4273: Uniform Container Erasure (Stephan T. Lavavej)

N4282: The World’s Dumbest Smart Pointer (Walter E. Brown)

N4270, N4288: New papers adopted for Library Fundamentals TS

Note: The following new papers (among other already-posted ones) were approved on Saturday at the end of last week's ISO C++ meeting for the Library Fundamentals Technical Specification

New WG21 papers are available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

N4270: Collected Edits to the Library Fundamentals TS (Alisdair Meredith)

N4288: Strike string_view::clear from the Library Fundamentals TS (Alisdair Meredith)

N4275, N4276: New papers adopted for Parallelism TS

Note: The following new papers (among other already-posted ones) were approved on Saturday at the end of last week's ISO C++ meeting for the Parallelism Technical Specification

New WG21 papers are available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

N4275: Response to National Body comments for C++ Extensions for Parallelism (Hans-J. Boehm)

N4276: Transform Reduce, an Additional Algorithm for C++ Extensions for Parallelism(Jared Hoberock)