Expressive initialization and assignment using Boost.Assign

Initializing an object or assigning some literal value to it using a single statement is a succinct way of generating the contents of the object. It is easy to do this for simple variables like numeric variables or strings, because there are readily available literals. On the other hand, there are no simple syntactic means of initializing containers with arbitrary sets of values. This is because expressing more complex objects with nontrivial internal data structures as literals is difficult. Using some ingenious patterns and overloaded operators, the Boost.Assign library makes it possible to initialize and assign values to a whole host of STL and Boost containers, using a very expressive ...

Get Learning Boost C++ Libraries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.