Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Boost provide an implementation of span for C++14?

Tags:

c++

boost

c++14

std::span was introduced in C++20, but I'm limited to C++14 and, to a lesser extent, to Boost libraries of any version. Is there something similar in Boost?

like image 249
L117 Avatar asked Mar 09 '20 20:03

L117


2 Answers

As of Boost-1.78, boost::span is now part of the Boost core (see Boost::span docs). This is a C++11/14/17 compatible implementation of std::span.

like image 172
E. Schiesser Avatar answered Oct 06 '22 00:10

E. Schiesser


Does Boost provide an implementation of span for C++14?

There is no span in the boost namespace. But Boost Beast library has boost::beast::span. It appears to not implement the same interface as std::span exactly, but is an implementation of the same similar idea.

There is also boost::hana::span which is something else.

like image 24
eerorika Avatar answered Oct 05 '22 23:10

eerorika