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::push_back - cpprefjp C++日本語リファレンス

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

最終更新日時: 2026年08月25日 12時11分17秒 (JST)
Akira Takahashi が更新

履歴 編集

function
<string>

std::basic_string::push_back

void push_back(charT c);           // (1) C++98
constexpr void push_back(charT c); // (1) C++20

概要

末尾に要素を追加する。

効果

append(static_cast<size_type>(1), c)

例

#include <iostream>
#include <string>

int main()
{
  std::string s = "hell";

  // 末尾に'o'を追加する
  s.push_back('o');

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

出力

hello

参照

  • P0980R1 Making std::string constexpr
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.