<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>A7M</author_name>
  <author_url>https://blog.hatena.ne.jp/A7M/</author_url>
  <blog_title>C++Builder好きの秘密基地</blog_title>
  <blog_url>https://a7m.hatenablog.jp/</blog_url>
  <categories>
  </categories>
  <description>ふとした疑問 std::vectorには最後尾の要素を取得するbackというメソッドがあります。 もし、vectorが空の場合backメソッドを呼ぶとどうなるのか実験してみました。 書いたコードはこんな感じ。期待する動作は空要素を返すか、何らかの例外を投げてくれるか。 #include &lt;vector&gt; #include &lt;string&gt; #include &lt;iostream&gt; int main(int argc, char* argv[]) { std::vector&lt;std::string&gt; StrList; try { auto v = StrList.back(); std::cout…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fa7m.hatenablog.jp%2Fentry%2F2019%2F01%2F19%2F211958&quot; title=&quot;実験：空のstd::vectorから要素を取得するとどうなるか？ - C++Builder好きの秘密基地&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-01-19 21:19:58</published>
  <title>実験：空のstd::vectorから要素を取得するとどうなるか？</title>
  <type>rich</type>
  <url>https://a7m.hatenablog.jp/entry/2019/01/19/211958</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
