Considerations for choosing the parallel computing strategy - Dori Exterman - @meetingcpp 2015
A new video from Meeting C++ 2015:
Considerations for choosing the parallel computing strategy
by Dori Exterman
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
By Meeting C++ | Feb 9, 2016 08:34 AM | Tags: performance multithread multiprocess intermediate efficiency c++11 advanced
A new video from Meeting C++ 2015:
Considerations for choosing the parallel computing strategy
by Dori Exterman
By Adrien Hamelin | Feb 8, 2016 06:11 AM | Tags: intermediate efficiency
What is the best thing to return?
Sometimes you get things wrong
by Marshall Clow
From the article:
A few years ago, Sean Parent challenged me to provide an implementation of Boyer-Moore searching in C++. I did that, first in boost and then, later as part of the proposed Library Fundamentals Technical Specification.
The idea here is that you have a searcher object, which encapsulates the actual searching. You construct it with the pattern that you want to search for, and then you call the searchers operator() with the corpus that you want to search, and it will return to you the start of the pattern in the corpus, if it exists, and the end of the corpus, if it does not (this is the same set of rules that std::search follows).
But this weekend I realized that this is not the right thing to return. The searcher (and std::search for that matter) should return a “range” (ok, a pair of iterators) denoting the beginning and end of the pattern in the corpus. (Yes, you can get the end of the pattern by incrementing the returned iterator by the length of the pattern, but that’s an O(N) operation if you only have forward iterators...
By Meeting C++ | Feb 4, 2016 10:00 AM | Tags: intermediate efficiency c++14 c++11 basics
A new post on the Meeting C++ blog, this time on <algorithm>
Raw loops vs. STL algorithms
by Jens Weller
From the article:
Since last week I am working on my CMS for static HTML pages again, and so the series about Building applications with Qt and boost continues. Today its about using STL algorithms, or how Sean Parent once said "no raw loops!". Now, I am not Sean Parent, and not event the implementers of the STL are perfect. Most code which I write is application code, which then powers Meeting C++. Also, I don't know all STL algorithms, and some times its just to tempting to write a little loop instead of searching the STL for the specific algorithm. Yesterday I had such a case.
By Adrien Hamelin | Feb 2, 2016 10:09 AM | Tags: c++14 advanced
How to use tuple return values with ease?
Emulating C++17 Structured Bindings in C++14
by John Bandela
From the article:
Bjarne Stroustrup back in Novemeber wrote a nice progress report, available here, of the Kona meeting. One of the proposals considered is called structured binding. The proposal addresses one of the inconveniences of returning multiple values from a function using tuples. While, it is very easy for a function to return multiple values, it is harder for the caller to use them. Here is an example from the write up.
consider the following function
tuple<T1,T2,T3> f() { /*...*/ return make_tuple(a,b,c); }If we want to split the tuple into variables without specifying the type, we have to do this;
auto t = f(); auto x = get<1>(t); auto y = get<2>(t); auto z = get<3>(t);The proposal puts forth the following syntax instead
auto {x,y,z} = f(); // x has type T1, y has type T2, z has type T3I am excited for this feature, and for C++17 in general. While waiting for C++17, I decided to see how close I could get with C++14. Here is the result.
auto r = AUTO_TIE(x,y,z) = f(); // x has type T1, y has type T2, z has type T3 // Unlike the C++17 feature, you need to use r.x instead of just x std::cout << r.x << "," << r.y << "," << r.z << "\n";
By Meeting C++ | Feb 1, 2016 06:51 AM | Tags: user groups community
The monthly listing of upcoming C++ User Group meetings at Meeting C++:
C++ User Group Meetings in February
by Jens Weller
From the article
The monthly overview on the upcoming C++ User Group meetings! In the shortest month of the year there are still 21 C++ User Groups which are meeting!
There are 7 new C++ User Groups: Sofia, Ho Chi Minh, Iasi, Noida, Macedonia, Buenos Aires, Stuttgart / Ludwigsburg (Qt).
By Adrien Hamelin | Feb 1, 2016 01:08 AM | Tags: intermediate
Constructing or not constructing, that is the question.
Constructor Failures
by Arne Mertz
From the article:
Sometimes we fail to acquire a needed resource or responsibility during the construction of an object. Sometimes the construction of a subobject fails. How can we deal with an incompletely constructed object?
By iterator | Jan 31, 2016 11:52 PM | Tags: None
An analysis and exploration of partition and remove algorithms. By combining aspects of these two, we rediscover useful algorithms that the Standard Library doesn't have.
Experiments in partition and remove
by Brent Friedman
From the article:
The C++ Standard Library exposes dozens of powerful algorithms for use in everyday software. Two of these algorithms, partition and remove_if, provide similar functionality for segregating data. If we dig carefully into implementations of these algorithms, a certain symmetry is exposed. This exploration will lead us to the discovery of useful algorithms that we can employ in our daily engineering work.
This article demonstrates particular algorithm implementations — but it is important to remember that the source code will vary between different implementations of the standard library, and can differ based on what sort of data you pass in.
By Meeting C++ | Jan 29, 2016 07:54 AM | Tags: performance intermediate experimental c++14 c++11 boost advanced
A new blog entry about parallelism and boost::future:
Using parallelism with boost::future
by Jens Weller
From the article:
... While I'm fine with that the application locks up kind of hard during writing a GB zip file (its only job), I'd like to be as fast as possible. Thats why I decided to parallelize the part of the application that reads the file paths via boost::filesystem...
By Meeting C++ | Jan 22, 2016 06:58 AM | Tags: conferences community c++17 basics
A short overview on what is to expect from C++ in 2016:
C++ in 2016
by Jens Weller
From the article:
Like in the previous years, a short outlook into the fresh year regarding C++...
By Mantosh Kumar | Jan 17, 2016 10:54 PM | Tags: intermediate
How to write customizable framework which would work on "practically any type". This article is continuation of author previous post: "Overload resolution".
A customizable framework
by Andrzej Krzemieński
From the article:
We want to provide a function (or a set of overloaded functions) that would ‘do the right job’ for ‘practically any type’, or for ‘as many types as possible’. As an example of such ‘job’ consider std::hash: what we want to avoid is the situation, where you want to use some type X as a key in the standard hash-map, but you are refused because std::hash does not ‘work’ for X. In order to minimize the disappointment, the Standard Library makes sure std::hash works with any reasonable built-in or standard-library type. For all the other types, that the Standard Library cannot know in advance, it offers a way to ‘customize’ std::hash so that they can be made to work with hash-maps.