Bjarne Stroustrup "Make Simple Tasks Simple!" at CodeRage 9 -- Wed Oct 29, 9-11am PDT

Don't forget to tune in tomorrow morning, North American Pacific time, as the CodeRage conference will replay the CppCon "Make Simple Things Simpler!" keynote and take live Q&A with the keynoter, Bjarne Stroustrup:

Bjarne Stroustrup "Make Simple Tasks Simple!" at CodeRage 9 -- Wednesday, Oct. 29: 9-11am PDT

by David Intersimone

From the article:

... This time we will be doing things a little bit differently. We will watch a replay of Bjarne's wonderful CppCon 2014 Keynote, "Make Simple Tasks Simple!", and then have a live Q&A with Bjarne to complete the 2 hour session. [This] will take place on Wednesday, October 29 from 9am to 11am Pacific Time (12noon to 2pm Eastern Time) on the C++ track live stream.

... You can submit questions live during the session or you can email questions in advance by sending them to davidi at embarcadero dot com using the subject line "Ask Bjarne during CodeRage 9".

Why a "file based" dependency manager rocks for C/C++

C/C++ file-based dependency manager

Biicode is a file based dependency manager for C++. That lets amazing things to happen, such as allowing to reuse individual files from previous projects without having to worry about packaging, setup or installs. Biicode tracks which files depends on which files, and use it to automatically define build targets, or manage dependencies accordingly. For example, you could just reuse the “Person” object from another project, and you will not depend on the other project's dependencies at all, as those files do not depend on them. And this is only the beginning, with this file based approach you can also do many other amazing things, stay tuned for next posts. We believe this is indeed a new paradigm for dependency management. We are still in beta, releasing based on our users feedback almost every week, towards such a system that could rock for all of us as developers. That means that we are not perfect, as I told you we are working hard and defining the best possible roadmap for our community, including open-sourcing the code and building all the necessary tools for production environments.

Help us improve, try it out

Template Metaprogramming with Modern C++: Templates in Depth -- Manu Sánchez

Template Metaprogramming Modern C++ in biicode

Recently on biicode:

Template Metaprogramming with Modern C++: Templates in Depth

by Manu Sánchez

From the article:

The last time  we learnt what metaprogramming was, how metaprogramming in C++ via templates works, and the functional spirit of the embedded language that C++ template metaprogramming is. In this post we will learn C++ templates in depth: Class and function templates, template parameters, variadic templates, all with in depth examples. ...

 

... Then the fact that the compiler only generates code which actually does something (All syntactic sugar that high-level constructs provide is thrown away):

int main()
{
    return Fibonacci<5>::value;
}

GCC 4.9 -std=c++11 -O0 x86 target:

main:                                   # @main
	movl	$55, 

Variadic Templates in C++ -- Eli Bendersky

plusprofilephoto.pngA nice tutorial on a feature that leads to convenient and safe calling code:

Variadic Templates in C++

by Eli Bendersky

From the article:

Prior to C++11, the only way to write functions that take an arbitrary number of arguments was to use variadic functions like printf, with the ellipsis syntax (...) and the accompanying va_ family of macros. If you've ever written code using this approach you know how cumbersome it is. In addition to being type unsafe (all type resolution has to be done explicitly with casts in va_arg, at runtime), it's also tricky to get right. The va_ macros perform low-level memory manipulation, and I've seen a lot of code that segfaults because it isn't using them carefully enough.

But what always bothered me most with this approach is leaving something that is clearly known at compile-time, to run-time. Yes, when we write a variadic function we don't know all the ways it's going to be used. But when the compiler puts the whole program together, it does know. It sees perfectly well all the invocations of the function throughout the program, and all the possible argument types it gets passed (types are, after all, resolved at compile-time in C++).

Variadic templates

One of the new features of C++11 is variadic templates. Finally, there's a way to write functions that take an arbitrary number of arguments in a type-safe way and have all the argument handling logic resolved at compile-time, rather than run-time. Variadic templates can be used for much more than just functions that take an arbitrary number of arguments; in this article I want to demonstrate some of these capabilities...

Urbana Proposals - C++17 insight?

I've started with my series on the proposals for the next C++ Committee Meeting:

Urbana Proposals - C++17 insight?

by Jens Weller

From the article:

A short series to give you an overview over the Papers submitted in the latest mailing for the C++ Committee Meeting in Urbana-Champaign in Illinois. At the beginning of November the C++ Committee will have its 3rd Meeting this year. As C++14 is now finished, the focus is clearly on the upcoming C++17 standard.

From the archives: "C++: as close as possible to C -- but no closer" -- A. Koenig and B. Stroustrup

n0007.PNGFor your Friday reading pleasure, we recently came across one of the very earliest C++ standardization papers written, with number N0007 (or call it "007"):

C++: as close as possible to C -- but no closer

by Andrew Koenig and Bjarne Stroustrup

It's interesting too see how much C++ has stayed true to its root design. And the thesis and contents of this paper are both remarkably current, and to be considered by those who would attempt to C-ify C++, or C++-ify C.

From the paper:

ANSI C and the C subset of C++ serve subtly different purposes. ...

The purpose of this note is to summarize the remaining differences between the draft ANSI C standard and C++, explain their motivation, and point out cases where these differences are less important than they might appear at first.