<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>suusanex</author_name>
  <author_url>https://blog.hatena.ne.jp/suusanex/</author_url>
  <blog_title>新しもの好きプログラマの耳より情報ブログ</blog_title>
  <blog_url>https://suusanex.hatenablog.jp/</blog_url>
  <categories>
  </categories>
  <description>C# 12 から導入されたCollection Expressionsは左辺の変数の型を考慮してくれるようなので、byteを宣言・初期化する時にとても便利だという話です。 次のような書き方はコンパイルエラーになります。これは、右辺の型がintと仮定されて、それをbyte[]へ代入しようとするためです。 byte[] arr = new [] { 1, 2, 3 }; 次のようにする必要があるため、あんまり記載量が減っていなくて少し面倒でした。 byte[] arr = new byte[] { 1, 2, 3 }; Collection Expressionsを使うと、次の書き方ができます。 …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsuusanex.hatenablog.jp%2Fentry%2F2024%2F09%2F27%2F095259&quot; title=&quot;C# 12のCollection Expressionsでbyte[]の初期化がちょっと楽になった - 新しもの好きプログラマの耳より情報ブログ&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>2024-09-27 09:52:59</published>
  <title>C# 12のCollection Expressionsでbyte[]の初期化がちょっと楽になった</title>
  <type>rich</type>
  <url>https://suusanex.hatenablog.jp/entry/2024/09/27/095259</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
