GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — std::basic_string::assign_range - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. string
  3. basic_string
  4. assign_range

最終更新日時: 2025年08月31日 19時06分36秒 (JST)
Raclamusi が更新

履歴 編集

function template
<string>

std::basic_string::assign_range(C++23)

template <container-compatible-range<charT> R>
constexpr basic_string& assign_range(R&& rg); // C++23

概要

Rangeの各要素を再代入する。

効果

return assign(basic_string(from_range, forward<R>(rg), get_allocator()));

戻り値

*this

例

#include <iostream>
#include <string>

int main()
{
  std::string s = "str";
  const char a[3] = {'i', 'n', 'g'};

  // Rangeを再代入
  s.assign_range(a);

  std::cout << s << std::endl;
}

出力

ing

関連項目

名前 説明
assign コンテナの再代入
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.