Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::span::data(3)	      C++ Standard Libary	    std::span::data(3)

NAME
       std::span::data - std::span::data

Synopsis
	  constexpr pointer data() const noexcept;

	  Returns a pointer to the beginning of	the sequence.

Return value
	  A pointer to the beginning of	the sequence.

Example
       // Run this code

	#include <span>
	#include <iostream>

	int main()
	{
	    constexpr char str[] = "ABCDEF\n";

	    const std::span sp{str};

	    for	(auto n{sp.size()}; n != 2; --n) {
		std::cout << sp.last(n).data();
	    }
	}

Output:
	ABCDEF
	BCDEF
	CDEF
	DEF
	EF
	F

See also
	  constructor	constructs a span
			(public	member function)

http://cppreference.com		  2022.07.31		    std::span::data(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::span::data&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help