Example Code From Presentations
|
Example code from the "std::span in C++" presentation. More...
#include <span>
#include <array>
#include <vector>
#include <string>
#include "catch2/catch_test_macros.hpp"
Example code from the "std::span in C++" presentation.
This presentation gives an overview of the std::span
class template in the C++ library. It is meant to be for both C++ programmers as well as non C++ programmers to give a short intro to the static compile time capabilities of the C++ language.
std::span
with it's non-type template parameter Extent
shows a capability not present in many languages - the ability to specify info that is present only at compile time, and does not cost runtime space or time.
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt or copy at https://www.boost.org/LICENSE_1_0.txt)