Giter Site home page Giter Site logo

hisupersylar / modern-cpp-programming-cookbook-second-edition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from packtpublishing/modern-cpp-programming-cookbook-second-edition

0.0 0.0 0.0 148 KB

Modern C++ Programming Cookbook, Second Edition, published by Packt

License: MIT License

CMake 2.30% C++ 97.18% Batchfile 0.52%

modern-cpp-programming-cookbook-second-edition's Introduction

Modern C++ Programming Cookbook - 2nd Edition

This is the code repository for Modern C++ Programming Cookbook - 2nd Edition, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

About the Book

Beginning with the modern language features, each recipe addresses a specific problem, with a discussion that explains the solution and offers insight into how it works. You will learn major concepts about the core programming language as well as common tasks faced while building a wide variety of software from enterprise grade apps to low latency software. You will learn about concepts such as concurrency, performance, testing, and more in the form of recipes. These recipes will ensure you can make your applications secure and fast.

Instructions and Navigation

All of the code is organized into folders, one for each chapter. Some chapters contain one header file for each recipe in that chapter. In this cases, the header files are called recipe_1_01.h, recipe_1_02.h, etc. Other chapters, contain multiple programs, one for each recipe. In this case, in recipe has its own folder with names such as chapter12_01_1, chapter12_01_2, etc.

The code will look like the following:

    #include <iostream>

    int main()
    {
      std::cout << "Hello World!\n";
    }

The code presented in the book is available for download from your account at https://www.packtpub.com/, although I encourage you to try writing all the samples by yourself. In order to compile them, you need VC++ 2019 16.5 on Windows and GCC 10.0 or Clang 11.0 on Linux and Mac. If you don't have the latest version of the compiler, or you want to try another compiler, you can use one that is available online. Although there are various online platforms that you could use, I recommend https://wandbox.org/ or https://godbolt.org/.

3rd party libraries

The following libraries are required/optional for building the code:

Libary Path Purpose
Boost.Test https://www.boost.org/ Testing projects in chapter 11
Google Test https://github.com/google/googletest Testing projects in chapter 11
Catch2 https://github.com/catchorg/Catch2 Testing projects in chapter 11
Range-v3 https://github.com/ericniebler/range-v3 Ranges examples in chapter 12
cppcoro https://github.com/lewissbaker/cppcoro Coroutines examples in chapter 12

Building the code

The code can be build using CMake. The CMake files provided with the source code require CMake 3.15.0 or newer. The following values can be set:

  • SKIP_TEST_PROJECTS Flag to prevent the generation of unit test projects (from chapter 11)
  • BOOST_PATH Path to the installation path of Boost (required unless SKIP_TEST_PROJECTS is ON)
  • GTEST_PATH Path to the installation path of Google Test (required unless SKIP_TEST_PROJECTS is ON)
  • GTEST_PATH_LIB Path to the Google Test libraries directory (required unless SKIP_TEST_PROJECTS is ON)
  • CATCH_PATH Path to the installation path of Catch2 (required unless SKIP_TEST_PROJECTS is ON)
  • RANGES_PATH Path to the installation path of Ranges-v3 (required if USE_RANGES_V3 is ON)
  • CPPCORO_PATH Path to the installation path of cppcoro (required for chapter 12)

The following example shows how to generate projects for Visual Studio 2019:

cmake -G "Visual Studio 16 2019" -DBOOST_PATH=c:/Work/Libraries/boost_1_73_0/ -DGTEST_PATH=c:/Work/Libraries/googletest_1_10/googletest/include/ -DGTEST_PATH_LIB=c:/Work/Libraries/googletest_1_10/lib/ -DCATCH_PATH=c:/Work/Libraries/Catch2/single_include/ -DUSE_RANGES_V3=ON -DRANGES_PATH=c:/Work/Libraries/range-v3-master/include/ -DCPPCORO_PATH=c:/Work/Libraries/cppcoro-master -S .\ -B .\build

Suggestions and Feedback

Click here if you have any feedback or suggestions.

modern-cpp-programming-cookbook-second-edition's People

Contributors

mariusbancila avatar packt-itservice avatar packtcaroll avatar sabypackt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.