名前空間
変種
操作

std::basic_string_view<CharT,Traits>::copy

提供: cppreference.com
 
 
 
 
size_type copy( CharT* dest, size_type count, size_type pos = 0 ) const;
(C++17以上)
(C++20未満)
constexpr size_type copy( CharT* dest, size_type count,
                          size_type pos = 0 ) const;
(C++20以上)

部分文字列 [pos, pos + rcount)dest の指す配列にコピーします。 ただし rcountcountsize() - pos の小さい方です。

Traits::copy(dest, data() + pos, rcount) と同等です。

目次

[編集] 引数

dest - コピー先の文字列を指すポインタ
pos - 最初の文字の位置
count - 要求される部分文字列の長さ

[編集] 戻り値

コピーした文字数。

[編集] 例外

pos > size() の場合、 std::out_of_range

[編集] 計算量

rcount に比例。

[編集] 関連項目

部分文字列を返します
(パブリックメンバ関数) [edit]