Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Examples

To run the examples, please go through the setup first.

Here is a list of available examples:

Tutorials

Self-contained programs demonstrating the basic concepts.

Simple programs

Self-contained programs demonstrating more advanced concepts and techniques.

Advanced examples

Programs implementing real-world functionality.

  1. The BoostServerTech chat project uses Boost.MySQL and Boost.Redis to implement a chat server

Setup

To run the examples, you need a MySQL server you can connect to. Examples make use of a database named boost_mysql_examples. The server hostname and credentials (username and password) are passed to the examples via the command line.

You can spin up a server quickly by using Docker:

# Remove the "-v /var/run/mysqld:/var/run/mysqld" part if you don't need UNIX sockets
> docker run --name some-mysql -p 3306:3306 -v /var/run/mysqld:/var/run/mysqld -d -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -d mysql

# All the required data can be loaded by running example/db_setup.sql.
# If you're using the above container, the root user has a blank password
> mysql -u root < example/db_setup.sql

Please note that this container is just for demonstrative purposes, and is not suitable for production.

The root MySQL user for these containers is root and has an empty password.


PrevUpHomeNext