<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>wata_d</author_name>
  <author_url>https://blog.hatena.ne.jp/wata_d/</author_url>
  <blog_title>閑古鳥</blog_title>
  <blog_url>https://www.little-cuckoo.jp/</blog_url>
  <categories>
    <anon>C++</anon>
    <anon>C#</anon>
  </categories>
  <description>0で初期化するなら何の苦労もないのだけど、1とか10にしたいって時。C++ならstd::fillがあるので: int arr[5]; std::fill(arr, arr + _countof(arr), 10); と書ける。さらにstd::vectorには初期値をコンストラクタで指定できるから: std::vector&lt;int&gt; arr(5/*要素数*/, 10/*値*/); で済む。C#だとどちらも類似機能がないので(多分)、どうしても一行で書くならこうなるのだろうか: var arr = Enumerable.Range(0, 5).Select(_ =&gt; 10).ToArray(); …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.little-cuckoo.jp%2Fentry%2F2015%2F08%2F25%2F193248&quot; title=&quot;配列を任意の値で初期化(fill)したい - 閑古鳥&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>2015-08-25 19:32:48</published>
  <title>配列を任意の値で初期化(fill)したい</title>
  <type>rich</type>
  <url>https://www.little-cuckoo.jp/entry/2015/08/25/193248</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
