Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::span<T,Extent>::data

      From cppreference.com
      <cpp‎ |container‎ |span
       
       
       
       
      constexpr pointer data()constnoexcept;
      (since C++20)

      Returns a pointer to the beginning of the underlying sequence.

      [edit]Return value

      data_

      [edit]Example

      Run this code
      #include <iostream>#include <span> int main(){constexprchar str[]="ABCDEF\n"; conststd::span sp{str}; for(auto n{sp.size()}; n!=2;--n)std::cout<< sp.last(n).data();}

      Output:

      ABCDEFBCDEFCDEFDEFEFF

      [edit]See also

      constructs aspan
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/container/span/data&oldid=182286"

      [8]ページ先頭

      ©2009-2025 Movatter.jp