<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>faith_and_brave</author_name>
  <author_url>https://blog.hatena.ne.jp/faith_and_brave/</author_url>
  <blog_title>Faith and Brave - C++で遊ぼう</blog_title>
  <blog_url>https://faithandbrave.hateblo.jp/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>Boost.RandomやC++標準のdiscrete_distributionは、確率テーブルに基いて、選択された0から始まるインデックスを返しますが、返される型はデフォルトでintになっています。 しかし、返される値は配列のインデックスとして使うのが一般的でしょうから、intではなくsize_tを生成して返してくれたほうが使いやすいです。 なので、discrete_distributionを使うときは、基本的にテンプレート引数にsize_tを指定するのがいいでしょう。 以下は、簡単なくじ引き(ガチャ)的な処理です。 #include &lt;iostream&gt; #include &lt;vector&gt;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffaithandbrave.hateblo.jp%2Fentry%2F20130411%2F1365671662&quot; title=&quot; discrete_distributionでsize_tを生成させる - Faith and Brave - C++で遊ぼう&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>2013-04-11 18:14:22</published>
  <title> discrete_distributionでsize_tを生成させる</title>
  <type>rich</type>
  <url>https://faithandbrave.hateblo.jp/entry/20130411/1365671662</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
