<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>toburau</author_name>
  <author_url>https://blog.hatena.ne.jp/toburau/</author_url>
  <blog_title>ゲームが作れるようになるまでがんばる日記</blog_title>
  <blog_url>https://toburau.hatenablog.jp/</blog_url>
  <categories>
    <anon>TIPS</anon>
  </categories>
  <description>vectorにランダムで作った数値などを格納して利用したい場合に、同じ数字は利用したくないという場合がある。そのようなときに重複した要素を削除する方法。 std::sortでソートして、std::uniqueで重複要素を削除し、eraseでサイズを調整する。 std::vector&lt;int&gt; test; std::sort(test.begin(), test.end()); test.erase(std::unique(test.begin(), test.end()), test.end()); via std::sortとstd::uniqueでstd::vectorの重複要素を削除する…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftoburau.hatenablog.jp%2Fentry%2F20171130%2F1512062553&quot; title=&quot;vectorから重複した要素を削除する - ゲームが作れるようになるまでがんばる日記&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>2017-11-30 02:22:33</published>
  <title>vectorから重複した要素を削除する</title>
  <type>rich</type>
  <url>https://toburau.hatenablog.jp/entry/20171130/1512062553</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
