home | help
std::basic_...asic_spanbuf(3)  C++ Standard Libary std::basic_...asic_spanbuf(3)

NAME
     std::basic_spanbuf::basic_spanbuf - std::basic_spanbuf::basic_spanbuf

Synopsis
	basic_spanbuf()  :  basic_spanbuf(std::ios_base::in |		     (1)
     (since C++23)
	std::ios_base::out) {}
	explicit basic_spanbuf( std::ios_base::openmode which  )	     (2)
     (since C++23)
	    : basic_spanbuf(std::span<CharT>{}, which) {}
	explicit basic_spanbuf( std::span<CharT> buf,
	std::ios_base::openmode  which	=				     (3)
     (since C++23)
				    std::ios_base::in | std::ios_base::out
	);
	basic_spanbuf( const basic_spanbuf& ) =  delete;		     (4)
     (since C++23)
	basic_spanbuf(	basic_spanbuf&&  rhs ); 			     (5)
     (since C++23)

	1) Default constructor. Creates a basic_spanbuf that has  no  underlying
     buffer and is
	opened	for  both input and output. The pointers to get and put area are
     set to the
	null pointer value.
	2) Same as (1), except that the basic_spanbuf is opened in  mode  speci-
     fied by which.
	3) Creates a basic_spanbuf that manages the underlying buffer referenced
     by buf (or
	has  no  underlying buffer if buf is empty) and is opened in mode speci-
     fied by which.
	The pointers to get and put area are set as following, or  to  the  null
     pointer value
	if not mentioned in the table:

		Set  bits in open mode			 Return value after set-
     ting
	  (affecting pointers to get area)     eback()	 gptr() 	     eg-
     ptr()
	std::ios_base::in			       s.data() 	s.data()
     s.data() +
									  s.size()
		Set bits in open mode			Return value after  set-
     ting
	  (affecting	 pointers    to    put	  area)       pbase()	  pptr()
     epptr()
	std::ios_base::out	&&			 s.data()	s.data()
     s.data() +
	!std::ios_base::ate
     s.size()
	std::ios_base::out     &&		      s.data()	   s.data()    +
     s.data() +
	std::ios_base::ate						s.size()
     s.size()

	4) Copy constructor is deleted. basic_spanbuf is not copyable.
	5)  Move constructor. Move-constructs the std::basic_streambuf base sub-
     object from
	that of rhs. The pointers to get and put area, the open  mode,	and  the
     underlying
	buffer (if any) are identical to those in rhs before construction.
	It  is	implementation-defined	whether  rhs  still holds the underlying
     buffer after the
	move-construction.

Parameters
	buf   - a std::span referencing the underlying buffer
	rhs   - another basic_spanbuf
		specifies stream open mode. It is bitmask  type,  the  following
     constants are
		defined:

		Constant	  Explanation
		app		  seek to the end of stream before each write
	which - binary		  open in binary mode
		in		  open for reading
		out		  open for writing
		trunc		   discard the contents of the stream when open-
     ing
		ate		  seek to the end of  stream  immediately  after
     open
		noreplace (C++23) open in exclusive mode

Notes
	These constructors are typically called by the constructors of
	std::basic_ispanstream,     std::basic_ospanstream,	and	std::ba-
     sic_spanstream.

Example
	 This section is incomplete
	 Reason: no example

See also
	constructor   constructs the basic_ispanstream
	(C++23) 	 (public    member    function	   of	  std::basic_is-
     panstream<CharT,Traits>)

	constructor   constructs the basic_ospanstream
	(C++23) 	   (public	member	    function	 of	std::ba-
     sic_ospanstream<CharT,Traits>)

	constructor   constructs the basic_spanstream
	(C++23) 	  (public     member	  function	of	std::ba-
     sic_spanstream<CharT,Traits>)

Category:
	  * Todo no example

http://cppreference.com 	   2024.06.10	   std::basic_...asic_spanbuf(3)

home | help