A conditional copy constructor -- Andrzej Krzemieński

Andrzej writes in his recent blog about an issue library writers have to take care of.

A conditional copy constructor

by Andrzej Krzemieński

From the article:

In this post we will try to define a ‘wrapper’ class template that does or does not have a copy constructor depending on whether the wrapped class has it. This will be a good opportunity to explore in depth a couple of advanced C++ features. Note that this is a rather advanced topic and, unless you are writing or maintaining a generic library, you will probably never need this knowledge.

CppCon 2014 Meta Techniques: Heterogeneous Polymorphism&Fast Prototyping at Facebook--Marcelo Juchem

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Meta Techniques: Heterogeneous Polymorphism & Fast Prototyping at Facebook

by Marcelo Juchem

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

As data driven systems evolve there's an ever growing demand for bringing new functionality into existing systems in an efficient, maintainable and least intrusive manner. When implementing features with different semantics or interfaces, virtual inheritance requires a compromise between design simplicity and performance. This implies a need for new techniques to achieve heterogeneous polymorphism efficiently. With C++11 and 14, type lists, type maps and variants can now be trivially implemented by the initiated. Facebook moves fast so we quickly adopted the new standards to further explore the capabilities of the type system. This talk demonstrates some meta-programming techniques like reflection and compile-time built structures to achieve heterogeneous polymorphism and fast prototyping.

C++ User Group Meetings in March

The monthly overview on the upcoming C++ User Group Meetings:

C++ User Group Meetings in March

by Jens Weller

The list of this month meetings:

4.3 C++ UG Saint Louis - DD Part 3 - C++11/14 Standard Libraries
5.3 C++ UG Paris - C++ FRUG #6 - La métaprogrammation, non non ca sert en vrai
11.3 C++ UG Utah - Graphics and Audio with Cinder
11.3 C++ UG Hungary - More Effective STL
11.3 C++ UG San Francisco/ Bay area - Experience with C++11 in ArangoDB
12.3 C++ UG NRW/Aachen - C++ User Gruppe (März)
12.3 C++ UG Dresden - Coding Dojo
12.3 C++ UG New York - How to Write A Shared Library
16.3 C++ UG Denver - C++ Lightning Talks
16.3 C++ UG Austin - North Austin Monthly C/C++ Pub Social
17.3 C++ UG Chicago - Richard Stallman
17.3 C++ UG Edinburgh - C++ Edinburgh
17.3 C++ UG Montpellier - Rencontre C++ mars
17.3 C++ UG Berlin - monthly meeting
18.3 C++ UG Bristol - Save the date
18.3 C++ UG Düsseldorf - Treffen der C++ User Gruppe NRW
18.3 C++ UG Ann Arbor - Meet & Greet
18.3 C++ UG Hamburg - C++ in der numerischen Programmierung
19.3 C++ UG Ruhrgebiet - surprise, surprise
24.3 C++ UG Portland - PDXCPP March Meeting
25.3 C++ UG San Francisco/ Bay area - Workshop and Discussion Group
26.3 C++ UG Bremen - First meetup
26.3 C++ UG Rhein-Neckar - C++ Usergroup Meeting
26.3 C++ UG Munich - Monthly Meeting
26.3 C++ UG Madrid - Sistemas Distribuidos con ZMQ y Google Protocol Buffers
27.3 C++ UG Istanbul - Smart Pointers - from 03 to 17

Vector Hosted Lists--Thomas Young

Want perfomance and speed? Vectors are the solution:

Vector Hosted Lists

by Thomas Young

From the article:

Vectors are great when adding or removing elements at the end of a sequence, but not so hot when deleting elements at arbitrary positions.

If that's a requirement, you might find yourself reaching for a pointer-based list.

Not so fast!

Memory locality is important, contiguous buffers are a really good thing, and a standard vector will often out-perform pointer-based lists even where you perform non-contiguous, list-style modifications such as arbitrary element deletion.

And we can 'host' a list within a vector to get the advantages of a contiguous buffer at the same time as 0(1) complexity for these kinds of manipulations...

Comparison of C++ Format and C library's printf -- Victor Zverovich

The C printf family is still the gold standard of performance for formatted I/O, but woefully fragile and inextensible. C++'s iostreams offers important advantages in type safety, but struggles with performance and internationalization.

A number of projects, such as Boost.Format, try to the advantages of both. Here's further discussion about one such library we linked to recently:

Comparison of C++ Format and C library's printf

by Victor Zverovich

From the article:

I was recently asked on GitHub why would someone use fmt::printf, which is a part of the C++ Format library, over the standard C library printf. This is a fair question and so I decided to write this blog post comparing the two.

Disclaimer: I’m the author of C++ Format, so this is all very biased =).

Google releases gRPC -- Mugur Marculescu

A new open source HTTP/2 RPC Framework for C++ and other languages has been released.

Introducing gRPC, a new open source HTTP/2 RPC Framework

by Mugur Marculescu

From the article:

Today, we are open sourcing gRPC, a brand new framework for handling remote procedure calls. It’s BSD licensed, based on the recently finalized HTTP/2 standard, and enables easy creation of highly performant, scalable APIs and microservices in many popular programming languages and platforms. Internally at Google, we are starting to use gRPC to expose most of our public services through gRPC endpoints as part of our long term commitment to HTTP/2.

CppCon 2014 Overview of Parallel Programming in C++--Pablo Halpern

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Overview of Parallel Programming in C++

 

by Pablo Halpern

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Parallel programming was once considered to be the exclusive realm of weather forecasters and particle physicists working on multi-million dollar super computers while the rest us relied on chip manufacturers to crank out faster CPUs every year. That era has come to an end. Clock speedups have been largely replaced by having more CPUs on a chip. Your typical smart phone now has 2 to 4 cores and your typical laptop or tablet has 4 to 8 cores. Servers have dozens of cores and supercomputers have thousands of cores.

If you want to speed up a computation on modern hardware, you need to take advantage of the multiple cores available. This talk is provides an overview of the parallelism landscape. We'll explore the what, why, and how of parallel programming, discuss the distinction between parallelism and concurrency and how they overlap, and learn about the problems that one runs into. We'll conclude with an overview of existing parallelism technologies in C++ and the future directions being considered for parallel programming in standard C++.

Operator Overloading – Introduction to Boost.Operators -- Arne Metz

Arne Mertz goes into the details of using boost operators.

Operator Overloading – Introduction to Boost.Operators, Part 1

Operator Overloading – Introduction to Boost.Operators, Part 2

by Arne Mertz

From the articles:

In my first two posts about operator overloading I have written about the basics and common practice. This post shows some lessons from the common practice post on a concrete example and then introduces to Boost.Operators, a library that conveniently reduces the boilerplate involved when overloading multiple operators for a class.

Operators Travel in Packs

If we look at the list of operators, we see that there are about 50 of them, and many of them can be overloaded in different ways. Even if we restrict ourselves to a few operations that make sense for a given class, then one of those operations often brings two or more operators.

 

SFINAE std::result_of? Yeah, right!--Scott Prager

On the matter of having a useful error message:

SFINAE std::result_of? Yeah, right!

by Scott Prager

From the article:

Return type deduction pre-decltype and auto could really make one mad. Back then, if you wanted a function object, you had to make it "adaptable", meaning it had to inherit from std::unary_ or binary_function and define its first_argument_type, second_argument_type, and result_type. There had been no concept of "transparent functors" allowing us to pass polymorphic functions to higher order functions (like std::plus<> to std::accumulate). For an example of programming in these dark ages, check out the FC++ FAQ.