Boost C++ Application Development Cookbook

With Boost libraries you can really unleash the power of C++. Learn to build applications faster and better through a cookbook approach that uses tons of recipes to make it all so easy to assimilate and apply.

Boost C++ Application Development Cookbook

Cookbook

Antony PolukhinAugust 2013

With Boost libraries you can really unleash the power of C++. Learn to build applications faster and better through a cookbook approach that uses tons of recipes to make it all so easy to assimilate and apply.

Book Details

About This Book

Explores how to write a program once and then use it on Linux, Windows, MacOS, and Android operating systems

Includes everyday use recipes for multithreading, networking, metaprogramming, and generic programming from a Boost library developer

Take advantage of the real power of Boost and C++ to get a good grounding in using it in any project

Who This Book Is For

This book is great for developers new to Boost, and who are looking to improve their knowledge of Boost and see some undocumented details or tricks. It’s assumed that you will have some experience in C++ already, as well being familiar with the basics of STL. A few chapters will require some previous knowledge of multithreading and networking. You are expected to have at least one good C++ compiler and compiled version of Boost (1.53.0 or later is recommended), which will be used during the exercises within this book.

Table of Contents

Chapter 1: Starting to Write Your Application

Introduction

Getting configuration options

Storing any value in a container/variable

Storing multiple chosen types in a variable/container

Using a safer way to work with a container that stores multiple chosen types

Split all the processes, computations, and interactions to tasks and process them independently

Learn the basics of working with graphs

Explore different helper macros used to detect compiler, platform and Boost features

Use selected C++11 features in C++03

In Detail

Boost libraries are developed by professionals, tested on multiple platforms and processor architectures, and contain reliable solutions for a wide range of tasks. This Cookbook takes you on a journey of simplifying the process of application development and guides you through writing perfect applications fast.

"Boost C++ Application Development Cookbook" provides you with a number of clear step-by-step recipes that will help you take advantage of the real power of Boost and C++, while giving you a good grounding in using it in any project.

"Boost C++ Application Development Cookbook" looks at the Boost libraries, and breaks down the mystery and confusion about which library to use in which situation. It will take you through a number of clear, practical recipes that will help you to take advantage of the readily available solutions.

Boost C++ Application Development Cookbook starts with teaching the basics of Boost libraries that are now mostly part of C++11 and leave no chance for memory leaks. Managing resources will become a piece of cake. We’ll see what kind of work can be done at compile time and what Boost containers can do. Do you think multithreading is a burden? Not with Boost. Think writing portable and fast servers is impossible? You’ll be surprised! Compilers and operating systems differ too much? Not with Boost. From manipulating images to graphs, directories, timers, files, strings – everyone will find an interesting topic.

You will learn everything for the development of high quality fast and portable applications. Write a program once and then you can use it on Linux, Windows, MacOS, Android operating systems.

Authors

Antony Polukhin

Antony Polukhin was born in Russia. As a child, he could speak the Russian and Hungarian languages and learned English at school. Since his school days, he was participating in different mathematics, physics, and chemistry competitions and winning them.
He was accepted into University twice: once for taking part in a city mathematics competition and again for gaining high score in an internal Universities mathematics and physics challenge. In his university life, there was not a year when he did not participate in an exam: he gained 'A's in all disciplines by writing highly difficult programs for each teacher. He met his future wife in university and graduated with honors.
For more than three years, he worked in a VoIP company developing business logic for a commercial alternative to Asterisc. During those days he started contributing to Boost and became a maintainer of the Boost.LexicalCast library. He also started making translations to Russian for Ubuntu Linux at that time.
Today, he develops a query engine for graph-oriented databases and continues to contribute to the open source. You may find his code in Boost libraries such as Any, LexicalCast, TypeTraits, Variant, and others.
He has been happily married for a year now.

Table of Contents

Chapter 1: Starting to Write Your Application

Introduction

Getting configuration options

Storing any value in a container/variable

Storing multiple chosen types in a variable/container

Using a safer way to work with a container that stores multiple chosen types

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.