<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>noriok</author_name>
  <author_url>https://blog.hatena.ne.jp/noriok/</author_url>
  <blog_title>n-diary</blog_title>
  <blog_url>https://noriok.hatenablog.com/</blog_url>
  <categories>
    <anon>D言語</anon>
  </categories>
  <description>配列をソートしたときの移動先インデックスを知りたい場合があります。 D 言語だと topNIndex 関数で知ることが出来ます。 import std; void main() { auto a = [99, 1, 100, 2, 150]; auto id = new int[a.length]; a.topNIndex(id, Yes.sortOutput); foreach (i; 0..a.length) { writefln(&quot;a[%d] = %d&quot;, id[i], a[id[i]]); } } 実行結果です。 a[1] = 1 a[3] = 2 a[0] = 99 a[2] = 1…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnoriok.hatenablog.com%2Fentry%2F2020%2F04%2F05%2F020143&quot; title=&quot;ソート後の移動先インデックスを求める - n-diary&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>2020-04-05 02:01:43</published>
  <title>ソート後の移動先インデックスを求める</title>
  <type>rich</type>
  <url>https://noriok.hatenablog.com/entry/2020/04/05/020143</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
