<?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>勉強</anon>
    <anon>C++</anon>
  </categories>
  <description>Effective C++ 第5章26項 コンストラクタやデストラクタを持つオブジェクトの変数を定義すると、生成や破棄するときにコストがかかる。なので、変数の定義は使われる直前で定義しようという話。 さらにループ内で使われる変数をループの外で定義するのが良いか、中で定義するのがよいかという話も。 外で定義してループ内で代入して使う場合のコード。 Test obj; for(int i=0; i&lt;n; ++i) { obj = iに依存する値; ... } 中で定義する場合のコード。 for(int i=0; i&lt;n; ++i) { Test obj(iに依存する値); ... } 自分はループ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftoburau.hatenablog.jp%2Fentry%2F20101105%2F1288968727&quot; title=&quot;変数の定義は可能な限り先延ばし - ゲームが作れるようになるまでがんばる日記&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>2010-11-05 23:52:07</published>
  <title>変数の定義は可能な限り先延ばし</title>
  <type>rich</type>
  <url>https://toburau.hatenablog.jp/entry/20101105/1288968727</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
