April 2020
Intermediate to advanced
412 pages
9h 58m
English
We are going to create an application that uses the power of the C++ standard library algorithms to generate and process fixed data frames without using dynamic memory allocation:
#include <iostream>#include <system_error>#include <variant>#include <unistd.h>#include <sys/fcntl.h>template <typename T>class Expected { std::variant<T, std::error_code> v;public: Expected(T val) : v(val) {} Expected(std::error_code e) : v(e) {} bool valid() const { return std::holds_alternative<T>(v); } const T& value() ...