boost

CppCon 2014 Boost.Asio and Boost.Serialization, Part II--Bryce Adelstein-Lelbach

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:

Boost.Asio and Boost.Serialization, Part II

by Bryce Adelstein-Lelbach

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Network programming in C++ frequently requires programmers to find a way to express C++ objects as a sequence of bytes which can be transmitted and reconstructed on another network endpoint. In the case of simpler objects (such as most PODs), object serialization is trivial to perform.

For more complex C++ constructs (polymorphic objects, etc), the approach to serialization is more challenging. This talk will discuss how two powerful Boost libraries, Asio and Serialization, can be used to craft C++ networking code that can handle a vast array of uses cases. A prototype for a message passing framework will be developed throughout the talk.

Programmers familiar with or interested in network programming (but perhaps unfamiliar with Boost.Asio, Boost.Serialization or both) are the intended audience. No prior knowledge of Boost.Asio and Boost.Serialization will be assumed, and alternatives to both libraries will be discussed.

CppCon 2014 Boost.Asio and Boost.Serialization, Part I--Bryce Adelstein-Lelbach

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:

Boost.Asio and Boost.Serialization, Part I

by Bryce Adelstein-Lelbach

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Network programming in C++ frequently requires programmers to find a way to express C++ objects as a sequence of bytes which can be transmitted and reconstructed on another network endpoint. In the case of simpler objects (such as most PODs), object serialization is trivial to perform.

For more complex C++ constructs (polymorphic objects, etc), the approach to serialization is more challenging. This talk will discuss how two powerful Boost libraries, Asio and Serialization, can be used to craft C++ networking code that can handle a vast array of uses cases. A prototype for a message passing framework will be developed throughout the talk.

Programmers familiar with or interested in network programming (but perhaps unfamiliar with Boost.Asio, Boost.Serialization or both) are the intended audience. No prior knowledge of Boost.Asio and Boost.Serialization will be assumed, and alternatives to both libraries will be discussed.

CppCon 2014 How you can make a Boost C++ Library--Robert Ramey

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:

How you can make a Boost C++ Library

by Robert Ramey

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

The purpose of this presentation is to encourage C++ programmers to create and submit new quality C++ libraries to Boost.

Premises: a) C++ needs more quality libraries b) There are many C++ programmers who would like to contribute libraries but they are discouraged by the amount of effort and associated heartache.

Methodology: Walk through the website www.blincubator.com from the point of view of a C++ library contributor. It will address issues related to requirements, suggested tools, user feedback, library promotion. It will assume that the attendee is an intermediate to advanced C++ programmer with an idea for a library.

Making Boost.Signals2 More OOP-Friendly -- Pavel Frolov

This article shows how modern C++ features, notably variadic templates and perfect forwarding, can be used to implement a generic variant of observer pattern without the help of either macros or proprietary compiler extensions.

Making Boost.Signals2 More OOP-Friendly

by Pavel Frolov

From the article:

The observer design pattern is by far the most popular and widely known among behavioural patterns. Unfortunately, unlike other mainstream languages out there, the C++ standard library doesn’t provide out of the box observer implementation. Luckily, Boost contains Signals2, a signal/slot library which can serve as a basis for an observer. Using Signals2 as it is, however, is not so convenient in object-oriented program due to the need of manually coded register and notify class methods for each of signal/slot pairs. This article suggests an observable mixin which attempts to solve the outlined problem.

Boost Version 1.58 Released

The next version of boost is released.

Boost 1.58

From the release note:

These new libraries were added:

  • Endian: Types and conversion functions for correct byte ordering and more regardless of processor endianness.
  • Sort: Includes spreadsort, a general-case hybrid radix sort that is faster than O(n*log(n))

A huge number of bugfixes and improvements were implemented for the existing libraries.

 

Many thanks to all contributors and maintainer!

Quick Q: Can I do something like range-for with a counting loop?

Quick A: Yes. Start with boost::irange.

Recently on SO:

Can I do something like range-for with a counting loop?

Actually this are two related questions.

I know there is new syntax in C++11 for range based for loops of the form:

//v is some container
for(auto &i: v){
   // do something with i
}

First question: how can I infer at which iteration I am in this loop? (Say I want to fill a vector with value j at position j).

Second question: I wanted to now if there also is some other way to write a loop of the form

for(int i=0; i<100; i++){ ... }

I find this way of writing it a bit cumbersome and I do this so often and I would love to have a more concise syntax for it. Something along the lines:

for(i in [0..99]){ ... }

would be great.

For both questions I would like to avoid having to use additional libraries.

Boost.Spirit + Flatbuffers + Catch + Biicode + CLion + Github--Max Galkin

Come see a nice product review:

Boost.Spirit + Flatbuffers + Catch + Biicode + CLion + Github

by Max Galkin

From the article:

This weekend I’m test-driving several new technologies. OK, OK, maybe not so new for everyone else, but new for me. I’m trying to write a parser for the Flatbuffers IDL grammar using Boost.Spirit, I’m referencing Boost using Biicode, I’m testing the code using Catch, I’m editing the project in CLion, and I’m pushing the results to Github yacoder/flatbuffers-with-spirit!

CppCon 2014 Rebuilding Boost Date-Time for C++11--Jeff Garland

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:

Rebuilding Boost Date-Time for C++11

by Jeff Garland

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Boost date_time is a widely used C++ library originally released in 2001 -- including being the basis for elements of the chrono library in c++11. While the library interface has stayed stable for more than a decade, the world around it has changed with the standard library and language changing. It is time for the library tobe rewritten to account for c++11.

The lecture describes in detail the design decisions and changes to the library for C++11. More generally it describes elements of design for a small valuetype library. Many of these considerations involve new features of C++11 and how they should be used. This includes noexcept, move construction/assignment (R-values), constexpr, enum classes, and user defined literals.

Bug of the week--Andrzej KrzemieĊ„ski

Here is an interesting bug:

Bug of the week

by Andrzej Krzemieński

From the article:

Today we are going to see a case study illustrating a bug. Not a very spectacular one: a typical bug one would encounter in everyday work. We will start with the symptoms, identify the root cause, and suggest measures to prevent similar things from happening in the future...

CppCon 2014 Metaprogramming with Boost.Hana: Unifying Boost.Fusion and Boost.MPL--Louis Dionne

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:

Metaprogramming with Boost.Hana: Unifying Boost.Fusion and Boost.MPL

by Louis Dionne

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Template metaprogramming sucks. No, seriously; you might like the imposed purely functional paradigm, but not the templates themselves. While C++11 has made our life easier, even simple metaprograms are often hard to write, impossible to maintain and slow to compile; we need better abstractions. In this talk, I will present Boost.Hana[1], an experimental C++14 library for heterogeneous computation. The library takes metaprogramming to a whole new level of expressiveness by unifying the well-known Boost.MPL and Boost.Fusion libraries under a single generic, purely functional interface. The library incorporates some of the most recent advances in C++ metaprogramming; I will give an overview of the most interesting implementation techniques used internally. Finally, I will show concrete ways to use the library so you, as a developer, can write less template black magic, increase your productivity and spend less time in coffee breaks waiting for the compiler (sorry).