<?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>modern C++: restrict templated types with concept</title><link>/technologies/code_exchange/b/blog/posts/modern-c-restrict-templated-types-with-concept</link><description>In C++, templates allow you to write generic code, that can handle many types. But almost always, there will be types you can&amp;#39;t handle.
In my case, I have a callback manager that supports functions that return a void, a number, a bool or a class...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: modern C++: restrict templated types with concept</title><link>https://community.element14.com/technologies/code_exchange/b/blog/posts/modern-c-restrict-templated-types-with-concept</link><pubDate>Wed, 12 Mar 2025 20:08:31 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:f3b78795-50d9-40c7-9e46-3ae21e9b54ca</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Analogy:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="274" src="/resized-image/__size/1000x548/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-f3b78795-50d9-40c7-9e46-3ae21e9b54ca/truckbrug.jpg" width="500" /&gt;&lt;/p&gt;
&lt;p&gt;source:&amp;nbsp;&lt;a id="" href="https://www.ajc.com/gdpr.html" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;https://www.ajc.com/gdpr.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Without concepts, the compiler would say: &amp;quot;the bridge&amp;nbsp;you are driving under&amp;nbsp;is not suited for trucks that don&amp;#39;t lower their load.&amp;quot;&lt;/p&gt;
&lt;p&gt;With concepts: &amp;quot;your truck will not fit under that bridge if you don&amp;#39;t properly lower that load on the truck bed.&amp;quot;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=28761&amp;AppID=74&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>