<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: why realsense should code like this?   auto&amp;&amp; frame : pipe.wait_for_frames() in Items with no label</title>
    <link>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683834#M15997</link>
    <description>&lt;P&gt;My understanding is that "auto &amp;amp;&amp;amp;" makes it a 'universal reference' that can be bound to anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When programming Librealsense, my advice is to use example programs as a base reference and then adjust the code to your own style if you believe that your own method of structuring code is more suitable.  Librealsense is open-source exactly so users can mold it to their needs and preferences.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Oct 2019 14:51:52 GMT</pubDate>
    <dc:creator>MartyG</dc:creator>
    <dc:date>2019-10-25T14:51:52Z</dc:date>
    <item>
      <title>why realsense should code like this?   auto&amp;&amp; frame : pipe.wait_for_frames()</title>
      <link>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683830#M15993</link>
      <description>&lt;P&gt;i saw the code example of&amp;nbsp;IntelRealSense/librealsense/examples/save-to-disk/rs-save-to-disk.cpp&amp;nbsp;from github.&lt;/P&gt;&lt;P&gt;link is &lt;A href="https://github.com/IntelRealSense/librealsense/blob/master/examples/save-to-disk/rs-save-to-disk.cpp#L34" target="_self" alt="https://github.com/IntelRealSense/librealsense/blob/master/examples/save-to-disk/rs-save-to-disk.cpp#L34"&gt;&lt;/A&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/blob/master/examples/save-to-disk/rs-save-to-disk.cpp#L34"&gt;https://github.com/IntelRealSense/librealsense/blob/master/examples/save-to-disk/rs-save-to-disk.cpp#L34&lt;/A&gt;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&amp;nbsp;line 34&amp;nbsp;&amp;nbsp;for (auto&amp;amp;&amp;amp; frame : pipe.wait_for_frames())&lt;/P&gt;&lt;P&gt;​why code like this rather "auto frame = pipe.wait_for_frames()"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and line 37 if (auto vf = &lt;A href="http://frame.as"&gt;frame.as&lt;/A&gt;&amp;lt;rs2::video_frame&amp;gt;())&lt;/P&gt;&lt;P&gt;rather "auto vf = frame.get_depth_frame()"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is any better to code this way?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 10:04:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683830#M15993</guid>
      <dc:creator>FritzY</dc:creator>
      <dc:date>2019-10-25T10:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: why realsense should code like this?   auto&amp;&amp; frame : pipe.wait_for_frames()</title>
      <link>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683831#M15994</link>
      <description>&lt;P&gt;is it in order to minimize the memory cost?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 10:14:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683831#M15994</guid>
      <dc:creator>FritzY</dc:creator>
      <dc:date>2019-10-25T10:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: why realsense should code like this?   auto&amp;&amp; frame : pipe.wait_for_frames()</title>
      <link>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683832#M15995</link>
      <description>&lt;P&gt;The link below explains why wait_for_frames is used and the alternatives to it.&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/issues/2422#issuecomment-423254709" target="_self" alt="https://github.com/IntelRealSense/librealsense/issues/2422#issuecomment-423254709"&gt;&lt;/A&gt;&lt;A href="https://github.com/IntelRealSense/librealsense/issues/2422#issuecomment-423254709"&gt;https://github.com/IntelRealSense/librealsense/issues/2422#issuecomment-423254709&lt;/A&gt;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;Using 'video' frame is an appropriate choice when only saving data as a simple PNG, and not a file format with embedded depth matrix information such as .raw. or .bin&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 13:00:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683832#M15995</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2019-10-25T13:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: why realsense should code like this?   auto&amp;&amp; frame : pipe.wait_for_frames()</title>
      <link>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683833#M15996</link>
      <description>&lt;P&gt;Thanks for reply, it 's really helpful.&lt;/P&gt;&lt;P&gt;            But what really disturb me is why it use A reference " auto &amp;amp;&amp;amp;" to define frame,  is it a better(tidy) wrriting  than using " = " to define an argument(the way we usually do)?and why?&lt;/P&gt;&lt;P&gt;            then using "as" methond to change the class of frame. on the contrary, I may use "get_depth_frame" function straightly if my purpose is to get a depth image.&lt;/P&gt;&lt;P&gt;            Perhaps it belongs to a c++ question boundary, but i would appriciate it if you give me some suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 14:37:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683833#M15996</guid>
      <dc:creator>FritzY</dc:creator>
      <dc:date>2019-10-25T14:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: why realsense should code like this?   auto&amp;&amp; frame : pipe.wait_for_frames()</title>
      <link>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683834#M15997</link>
      <description>&lt;P&gt;My understanding is that "auto &amp;amp;&amp;amp;" makes it a 'universal reference' that can be bound to anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When programming Librealsense, my advice is to use example programs as a base reference and then adjust the code to your own style if you believe that your own method of structuring code is more suitable.  Librealsense is open-source exactly so users can mold it to their needs and preferences.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 14:51:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683834#M15997</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2019-10-25T14:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: why realsense should code like this?   auto&amp;&amp; frame : pipe.wait_for_frames()</title>
      <link>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683835#M15998</link>
      <description>&lt;P&gt;My opinion is maybe it's a memory saving way to code like this. Anyway, thanks you very much.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 15:02:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/why-realsense-should-code-like-this-auto-frame-pipe-wait-for/m-p/683835#M15998</guid>
      <dc:creator>FritzY</dc:creator>
      <dc:date>2019-10-25T15:02:17Z</dc:date>
    </item>
  </channel>
</rss>

