<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Blog - All Comments</title><link>/technologies/code_exchange/b/blog</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: C++ moving and returning objects part 2: move and copy  (embedded friendly C++)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/c-moving-and-returning-objects-part-2-move-and-copy---rule-of-six</link><pubDate>Tue, 13 Jan 2026 18:35:39 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:570ab178-4dbe-44b2-b7b2-c9077c66a62c</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I used &lt;a href="https://en.wikipedia.org/wiki/Copy_elision#Summary" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;wikipedia&amp;#39;s test case&lt;/a&gt; to check if C++ actually&amp;nbsp;manages to allocate an object, created in a function, directly in its final memory location: yes&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:57e0d5ac-8dfb-48ce-add2-d3b2be1c8345:type=csharp&amp;text=%23include%20%3Ciostream%3E%0D%0A%0D%0Astruct%20MyStruct%20%7B%0D%0A%20%20%20%20MyStruct%28%29%20%3D%20default%3B%0D%0A%20%20%20%20MyStruct%28%5B%5Bmaybe_unused%5D%5D%20const%20MyStruct%26%20x%29%20%7B%0D%0A%20%20%20%20%20%20%20%20std%3A%3Acout%20%3C%3C%20%28%22A%20copy%20was%20made.%5Cn%22%29%3B%20%7D%0D%0A%7D%3B%0D%0A%0D%0AMyStruct%20f%28%29%20%7B%0D%0A%20%20%20%20return%20MyStruct%28%29%3B%0D%0A%7D%0D%0A%0D%0AMyStruct%20f_named%28%29%20%7B%0D%0A%20%20%20%20MyStruct%20m%3B%0D%0A%20%20%20%20return%20m%3B%0D%0A%7D%0D%0A%0D%0Aint%20main%28%29%20%7B%0D%0A%20%20%20%20std%3A%3Acout%20%3C%3C%20%28%22Hello%20World%21%5Cn%22%29%3B%0D%0A%20%20%20%20MyStruct%20obj%20%3D%20f%28%29%3B%0D%0A%20%20%20%20MyStruct%20obj2%20%3D%20f_named%28%29%3B%0D%0A%7D]&lt;/p&gt;
&lt;p&gt;obj and obj2 are 2 MyStruct objects.&amp;nbsp;Even though they are created inside functions ( f() and f_named() ), there is no copying when these 2 functions exit.&lt;br /&gt;They actually construct the object in the memory that&amp;#39;s allocated in main directly.&lt;/p&gt;
&lt;p&gt;C++ knows that the function&amp;nbsp;return values are temporary and not used after the function exits.&lt;br /&gt;So instead of creating a temporary object, and using a copy into obj or obj2 at return, it directly does the work in the&amp;nbsp;destination object.&lt;/p&gt;
&lt;p&gt;result: using a function to&amp;nbsp;factor an object comes without any runtime cost.&lt;/p&gt;
&lt;p&gt;&lt;img height="598" src="/resized-image/__size/1000x1196/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-570ab178-4dbe-44b2-b7b2-c9077c66a62c/pastedimage1768329465932v1.png" width="500" alt=" " /&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29083&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: modern C++: write my own function that returns true / false, and a value, part 2 (embedded friendly)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/modern-c-write-my-own-function-that-returns-true-false-and-a-value-part-2-embedded-friendly</link><pubDate>Sat, 06 Dec 2025 19:03:58 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:9b9f00f1-c981-4ed1-91c8-e57640b80304</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;code in action,&amp;nbsp;for a Raspberry Pico GPS design:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="546" src="/resized-image/__size/998x1092/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-9b9f00f1-c981-4ed1-91c8-e57640b80304/pastedimage1765047595678v1.png" width="499" /&gt;&lt;/p&gt;
&lt;p&gt;19&amp;nbsp;satellites in view from my back window. The parser mechanism described above is used. stl algorithms split the found satellites into glonass and gps types.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29406&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: modern C++: write my own function that returns true / false, and a value, part 2 (embedded friendly)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/modern-c-write-my-own-function-that-returns-true-false-and-a-value-part-2-embedded-friendly</link><pubDate>Thu, 04 Dec 2025 23:33:33 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:9b9f00f1-c981-4ed1-91c8-e57640b80304</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice post Jan.&lt;/p&gt;
&lt;p&gt;I like the idea of getting&amp;nbsp;multiple types of information directly from functions.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29406&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: modern C++: write my own function that returns true / false, and a value, part 2 (embedded friendly)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/modern-c-write-my-own-function-that-returns-true-false-and-a-value-part-2-embedded-friendly</link><pubDate>Thu, 04 Dec 2025 19:42:10 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:9b9f00f1-c981-4ed1-91c8-e57640b80304</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I flagged this as embedded friendly, but there is a caveat for ARM controllers:&lt;/p&gt;
&lt;p&gt;It needs C++ 15. If you are using a Raspberry Pico 2, in RISC-V mode, it will work. GCC15 is released for that.&lt;/p&gt;
&lt;p&gt;But as of today, there is no published ARM GCC 15 toolchain. If the OpenArm initiative sticks to its schedule, a version 15 release is imminent...&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29406&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: modern C++: initialise a static array inside a class</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/modern-c-initialise-a-static-array-inside-a-class</link><pubDate>Fri, 28 Nov 2025 19:53:14 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:0b58bf10-b75b-45fa-83ec-01208e56c9b5</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice update Jan.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29378&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Generate Awesome ASCII ART with QAAA.py</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/generate-awesome-ascii-art-with-qaaa-py</link><pubDate>Wed, 26 Nov 2025 00:34:26 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:159b3e6a-d502-42c7-830d-7778f5853eb3</guid><dc:creator>colporteur</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Shades of customer terminal windows. Cool!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29375&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: modern C++: initialise a static array inside a class</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/modern-c-initialise-a-static-array-inside-a-class</link><pubDate>Mon, 24 Nov 2025 21:06:51 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:0b58bf10-b75b-45fa-83ec-01208e56c9b5</guid><dc:creator>vmate</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;A notable exception is that with constexpr arrays, this can be done pre-c++17:&lt;br /&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:47de98d5-fed6-4b84-9725-142ddc6d2327:type=c_cpp&amp;text=class%20myclass%20%7B%0Apublic%3A%0A%20%20%20%20static%20constexpr%20uint32_t%20myarray%5B4%5D%20%3D%20%7B1%2C%202%2C%203%2C%204%7D%3B%0A%7D%3B]&lt;br /&gt;&lt;br /&gt;Also, in recent versions of C++, std::array should probably be used instead of &amp;#39;regular&amp;#39; arrays:&lt;br /&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:b0b6e540-4942-478a-99eb-9bcccb49e685:type=c_cpp&amp;text=class%20myclass%20%7B%0Aprivate%3A%0A%20%20%20%20inline%20static%20std%3A%3Aarray%3Cuint32_t%2C%204%3E%20myarray%20%3D%20%7B0%7D%3B%0A%7D]&lt;br /&gt;Instead of myarray becoming a uint32_t pointer, and then the programmer is responsible for doing everything correctly with it, std::array actually behaves as a proper object, it knows its own size, can be assigned properly to another array, etc. It has a bunch of convenience features like .begin() and .end() too, and it is zero cost.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29378&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: C++ write your own stream class - part 1: output stream initial design (embedded friendly C++)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/c-write-your-own-stream-class---part-1-output-stream-initial-design-embedded-friendly-c</link><pubDate>Sat, 15 Nov 2025 15:00:58 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8c59a5c6-a3c4-4c0f-93f7-663176067def</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;a real world example. Implementation for a Raspberry Pico. Using its UART api:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="268" src="/resized-image/__size/992x536/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8c59a5c6-a3c4-4c0f-93f7-663176067def/pastedimage1763218777901v1.png" width="496" /&gt;&lt;/p&gt;
&lt;p&gt;Code:&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:a562dd8b-d276-4ce2-9069-2f6f482f7585:type=csharp&amp;text=class%20uartostream%20%7B%0Apublic%3A%0A%20%20%20%20uartostream%28%29%20%7B%7D%0A%0A%20%20%20%20uartostream%26%20operator%20%3C%3C%20%28const%20char%2A%20msg%29%20%7B%0A%20%20%20%20%20%20%20%20uart_puts%28UART_ID%2C%20msg%29%3B%0A%20%20%20%20%20%20%20%20return%20%2Athis%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20uartostream%26%20operator%20%3C%3C%20%28const%20std%3A%3Astring%26%20msg%29%20%7B%0A%20%20%20%20%20%20%20%20uart_puts%28UART_ID%2C%20msg.c_str%28%29%29%3B%0A%20%20%20%20%20%20%20%20return%20%2Athis%3B%0A%20%20%20%20%7D%0A%7D%3B]&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29344&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: C++ write your own stream class - part 1a: the cost of objects can be zero (embedded friendly C++)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/c-write-your-own-stream-class---part-1a-the-cost-of-objects-can-be-zero-embedded-friendly-c</link><pubDate>Thu, 13 Nov 2025 20:38:25 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:9eae9fa2-f977-4d6e-8447-95f82795e6ae</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice update Jan.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29353&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: C++ write your own stream class - part 1a: the cost of objects can be zero (embedded friendly C++)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/c-write-your-own-stream-class---part-1a-the-cost-of-objects-can-be-zero-embedded-friendly-c</link><pubDate>Thu, 13 Nov 2025 17:46:04 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:9eae9fa2-f977-4d6e-8447-95f82795e6ae</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In case you want to embark on a RISC vs ARM tangent: this post is not about that.&lt;br /&gt;It&amp;#39;s a comparison about C++ and C designs, and a check: are C++ constructs too expensive for microcontrollers (any)?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;d be interested into a GCC vs other toolchains battle though ...&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29353&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: C++ write your own stream class - part 1a: the cost of objects can be zero (embedded friendly C++)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/c-write-your-own-stream-class---part-1a-the-cost-of-objects-can-be-zero-embedded-friendly-c</link><pubDate>Thu, 13 Nov 2025 16:38:29 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:9eae9fa2-f977-4d6e-8447-95f82795e6ae</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I added the RISC-V assembler:&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:2ff237af-4343-4f39-b075-b5fadb28a4fe:type=text&amp;text=main%3A%0A%20%20%20%20%20%20%20%20addi%20%20%20%20sp%2Csp%2C-16%0A%20%20%20%20%20%20%20%20li%20%20%20%20%20%20a5%2C53%0A%20%20%20%20%20%20%20%20sb%20%20%20%20%20%20a5%2C15%28sp%29%0A%20%20%20%20%20%20%20%20li%20%20%20%20%20%20a0%2C0%0A%20%20%20%20%20%20%20%20addi%20%20%20%20sp%2Csp%2C16%0A%20%20%20%20%20%20%20%20jr%20%20%20%20%20%20ra]&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29353&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: C++ write your own stream class - part 1: output stream initial design (embedded friendly C++)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/c-write-your-own-stream-class---part-1-output-stream-initial-design-embedded-friendly-c</link><pubDate>Wed, 12 Nov 2025 17:14:31 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8c59a5c6-a3c4-4c0f-93f7-663176067def</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Is this expensive? The facts&lt;/p&gt;
&lt;p&gt;When I use a subclass uartiostream and its &amp;lt;&amp;lt; operator:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="287" src="/resized-image/__size/1002x574/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8c59a5c6-a3c4-4c0f-93f7-663176067def/pastedimage1762967342953v2.png" width="501" /&gt;&lt;/p&gt;
&lt;p&gt;This compiles to&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span&gt;main&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;mov&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;r3&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;#53&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;mov&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;r0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;#0&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;sub&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;sp&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;sp&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;#8&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;strb&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;r3&lt;/span&gt;&lt;span&gt;, [&lt;/span&gt;&lt;span&gt;sp&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;#7&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;add&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;sp&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;sp&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;#8&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;bx&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;lr&lt;/span&gt;&lt;br /&gt;&lt;span&gt;u&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;.space&lt;/span&gt;&lt;span&gt; &amp;nbsp;&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;when I use plain C to do the same:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="97" src="/resized-image/__size/994x194/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-8c59a5c6-a3c4-4c0f-93f7-663176067def/pastedimage1762967477247v3.png" width="497" /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;main&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;mov&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;r3&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;#53&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;mov&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;r0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;#0&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;sub&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;sp&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;sp&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;#8&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;strb&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;r3&lt;/span&gt;&lt;span&gt;, [&lt;/span&gt;&lt;span&gt;sp&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;#7&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;add&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;sp&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;sp&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;#8&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;bx&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;lr&lt;/span&gt;&lt;/pre&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The only difference is a single address location (32 bits) to hold the object u&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;0&amp;nbsp;cpu cycles&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;That&amp;#39;s virtually cost-free&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29344&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: C++ write your own stream class - part 1: output stream initial design (embedded friendly C++)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/c-write-your-own-stream-class---part-1-output-stream-initial-design-embedded-friendly-c</link><pubDate>Tue, 11 Nov 2025 20:37:34 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8c59a5c6-a3c4-4c0f-93f7-663176067def</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice post Jan.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29344&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: C++ write your own stream class - part 1: output stream initial design (embedded friendly C++)</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/c-write-your-own-stream-class---part-1-output-stream-initial-design-embedded-friendly-c</link><pubDate>Tue, 11 Nov 2025 20:26:39 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8c59a5c6-a3c4-4c0f-93f7-663176067def</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Defining an input streamer has the same complexity as the output streamer.&lt;/p&gt;
&lt;p&gt;Once&amp;nbsp;the in- and out-streamers are written, writing a bidirectional one isn&amp;#39;t that difficult:&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:cc081195-6eb2-4329-af2e-fb1d07d62d54:type=csharp&amp;text=class%20uartistream%20%7B%0D%0Apublic%3A%0D%0A%20%20uartistream%28%29%20%7B%7D%0D%0A%20%20%0D%0A%20%20uartistream%26%20operator%20%3E%3E%20%28std%3A%3Astring%26%20msg%29%20%7B%0D%0A%20%20%20%20%2F%2F%20read%20from%20UART%0D%0A%20%20%20%20return%20%2Athis%3B%0D%0A%20%20%7D%20%20%0D%0A%20%20uartistream%26%20operator%20%3E%3E%20%28char%2A%20msg%29%20%7B%0D%0A%20%20%20%20%20%20%2F%2F%20read%20from%20UART%0D%0A%20%20%20%20return%20%2Athis%3B%0D%0A%20%20%7D%0D%0A%7D%3B%0D%0A%0D%0Aclass%20uartiostream%3A%20public%20uartistream%2C%20public%20uartostream%20%7B%0D%0A%7D%3B]&lt;/p&gt;
&lt;p&gt;Inheriting form both base classes doesn&amp;#39;t cost anything - because I didn&amp;#39;t define any virtual functions.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The difficult work will be at the lower level: write the implementation of the &amp;lt;&amp;lt; and &amp;gt;&amp;gt; operators using device dependent UART&amp;nbsp;APIs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29344&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: modern C++ for loop, but you still want an index</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/modern-c-for-loop-but-you-still-want-an-index</link><pubDate>Fri, 07 Nov 2025 02:58:06 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:9183c041-eb49-4a15-8c01-3757463c53a9</guid><dc:creator>Stuart_S</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Is the &amp;#39;auto&amp;#39; keyword valid in basic C, I might give it a shot on the old DevCPP&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=29326&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>