span_utils.hpp

A set of simple functions to manipulate std::span.

This file is part of Empirical, https://github.com/devosoft/Empirical Copyright (C) 2022 Michigan State University MIT Software license; see doc/LICENSE.md

Note

Status: BETA

Defines

INCLUDE_EMP_DATASTRUCTS_SPAN_UTILS_HPP_GUARD

Functions

template<typename T>
void Print(const std::span<T> &v, std::ostream &os = std::cout, const std::string &spacer = " ")

Print the contents of a span.

template<typename T, size_t SIZE>
auto to_span(array<T, SIZE> a)

Convert an array to an equivalent span.

template<typename T, typename ...Ts>
auto to_span(vector<T, Ts...> v)

Convert an vector to an equivalent span.

namespace std

STL namespace.

Functions

template<typename T>
std::ostream &operator<<(std::ostream &out, std::span<T> s)
template<typename T>
std::istream &operator>>(std::istream &is, std::span<T> s)