<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: Function Aliases In C++	</title>
	<atom:link href="https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Fri, 19 Oct 2018 08:16:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.3</generator>
	<item>
		<title>
		By: leni536		</title>
		<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1395</link>

		<dc:creator><![CDATA[leni536]]></dc:creator>
		<pubDate>Fri, 19 Oct 2018 08:16:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1658#comment-1395</guid>

					<description><![CDATA[One can&#039;t alias to operators with auto variables. One possible use case would be to alias user-defined literals to different ud-suffix as provided by a library. It could be needed to avoid ud-suffix clashes from different libraries.
Also the auto approach doesn&#039;t work with overloaded function types due to ambiguity.

Note that the macro approach works for both cases above (it doesn&#039;t assume that lowLevelF is actually a template). But the macro approach only works for function templates where all template arguments can be deduced from the parameters. In fact it only works for template functions where the template arguments are exactly the parameter types. It can&#039;t be used to alias std::make_unique for example. I wonder if a more general macro is possible, I can&#039;t come up with one. It also can&#039;t be used in function scope as template functions can&#039;t be declared there (I still don&#039;t know why it&#039;s not lifted already).

I don&#039;t say that these approaches are not useful, I just state some shortcomings. Obviously one can fall back to the one-liner approach if all these fail.]]></description>
			<content:encoded><![CDATA[<p>One can&#8217;t alias to operators with auto variables. One possible use case would be to alias user-defined literals to different ud-suffix as provided by a library. It could be needed to avoid ud-suffix clashes from different libraries.<br />
Also the auto approach doesn&#8217;t work with overloaded function types due to ambiguity.</p>
<p>Note that the macro approach works for both cases above (it doesn&#8217;t assume that lowLevelF is actually a template). But the macro approach only works for function templates where all template arguments can be deduced from the parameters. In fact it only works for template functions where the template arguments are exactly the parameter types. It can&#8217;t be used to alias std::make_unique for example. I wonder if a more general macro is possible, I can&#8217;t come up with one. It also can&#8217;t be used in function scope as template functions can&#8217;t be declared there (I still don&#8217;t know why it&#8217;s not lifted already).</p>
<p>I don&#8217;t say that these approaches are not useful, I just state some shortcomings. Obviously one can fall back to the one-liner approach if all these fail.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1287</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 09 Sep 2018 16:15:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1658#comment-1287</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1281&quot;&gt;Lê Huy&lt;/a&gt;.

Hi Lê, by looking at the code, it seems that the problem is that you&#039;re trying to alias a class method, and I don&#039;t think you can do this in C++. Note I&#039;m not 100% sure about this since I couldn&#039;t find any documentation about it.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1281">Lê Huy</a>.</p>
<p>Hi Lê, by looking at the code, it seems that the problem is that you&#8217;re trying to alias a class method, and I don&#8217;t think you can do this in C++. Note I&#8217;m not 100% sure about this since I couldn&#8217;t find any documentation about it.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lê Huy		</title>
		<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1284</link>

		<dc:creator><![CDATA[Lê Huy]]></dc:creator>
		<pubDate>Sat, 08 Sep 2018 14:23:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1658#comment-1284</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1282&quot;&gt;Lê Huy&lt;/a&gt;.

*** For case 2 https://uploads.disquscdn.com/images/441ce3785d27842b8c0c8ad2527c8f8628441b481b2c212bfd920e7b2abd7b54.png]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1282">Lê Huy</a>.</p>
<p>*** For case 2 <a href="https://uploads.disquscdn.com/images/441ce3785d27842b8c0c8ad2527c8f8628441b481b2c212bfd920e7b2abd7b54.png" rel="nofollow ugc">https://uploads.disquscdn.com/images/441ce3785d27842b8c0c8ad2527c8f8628441b481b2c212bfd920e7b2abd7b54.png</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lê Huy		</title>
		<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1283</link>

		<dc:creator><![CDATA[Lê Huy]]></dc:creator>
		<pubDate>Sat, 08 Sep 2018 14:22:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1658#comment-1283</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1281&quot;&gt;Lê Huy&lt;/a&gt;.

*** For case 1 https://uploads.disquscdn.com/images/09033a32b16b9f1c0245d7da395f3dee0e257916746a516cc4a59ba129fe0bc9.png]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1281">Lê Huy</a>.</p>
<p>*** For case 1 <a href="https://uploads.disquscdn.com/images/09033a32b16b9f1c0245d7da395f3dee0e257916746a516cc4a59ba129fe0bc9.png" rel="nofollow ugc">https://uploads.disquscdn.com/images/09033a32b16b9f1c0245d7da395f3dee0e257916746a516cc4a59ba129fe0bc9.png</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lê Huy		</title>
		<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1282</link>

		<dc:creator><![CDATA[Lê Huy]]></dc:creator>
		<pubDate>Sat, 08 Sep 2018 14:11:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1658#comment-1282</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1281&quot;&gt;Lê Huy&lt;/a&gt;.

When I try:
template using reset = typename option::array::initialize;
...
reset();

I get error:
1) &#039;reset&#039;: use of alias template requires template argument list
2) syntax error: unexpected type &#039;reset&#039;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1281">Lê Huy</a>.</p>
<p>When I try:<br />
template using reset = typename option::array::initialize;<br />
&#8230;<br />
reset();</p>
<p>I get error:<br />
1) &#8216;reset&#8217;: use of alias template requires template argument list<br />
2) syntax error: unexpected type &#8216;reset&#8217;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lê Huy		</title>
		<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-1281</link>

		<dc:creator><![CDATA[Lê Huy]]></dc:creator>
		<pubDate>Sat, 08 Sep 2018 14:05:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1658#comment-1281</guid>

					<description><![CDATA[// a.h
namespace option {
    template 
    class array
    {
    	    public:
		    int _data[_Size];
	    protected:
		    void initialize();
	    public:
		    array();
		    virtual ~array();
    };
}
// a.cpp
template const auto&#038; reset = option::array::initialize;
template option::array::~array()
{
	reset();
}
I get error:
1) &#039;reset&#039;: use of a variable template requires template argument list
2) &#039;reset&#039;: cannot be used before it is initialized
How can I fix it sir?]]></description>
			<content:encoded><![CDATA[<p>// a.h<br />
namespace option {<br />
    template<br />
    class array<br />
    {<br />
    	    public:<br />
		    int _data[_Size];<br />
	    protected:<br />
		    void initialize();<br />
	    public:<br />
		    array();<br />
		    virtual ~array();<br />
    };<br />
}<br />
// a.cpp<br />
template const auto&amp; reset = option::array::initialize;<br />
template option::array::~array()<br />
{<br />
	reset();<br />
}<br />
I get error:<br />
1) &#8216;reset&#8217;: use of a variable template requires template argument list<br />
2) &#8216;reset&#8217;: cannot be used before it is initialized<br />
How can I fix it sir?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-622</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 29 Oct 2017 00:23:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1658#comment-622</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-620&quot;&gt;dutiona&lt;/a&gt;.

Well spotted, the compilation error appears indeed with several parameters. Typo fixed, thanks!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-620">dutiona</a>.</p>
<p>Well spotted, the compilation error appears indeed with several parameters. Typo fixed, thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-621</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 29 Oct 2017 00:15:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1658#comment-621</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-619&quot;&gt;Risto Lankinen&lt;/a&gt;.

Well this is not supposed to work: using makes aliases on types, and not on functions.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-619">Risto Lankinen</a>.</p>
<p>Well this is not supposed to work: using makes aliases on types, and not on functions.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: dutiona		</title>
		<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-620</link>

		<dc:creator><![CDATA[dutiona]]></dc:creator>
		<pubDate>Fri, 27 Oct 2017 20:27:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1658#comment-620</guid>

					<description><![CDATA[std::forward(args...) is wrong.
std::forward(args)... is correct.
Don&#039;t forget to compile the code you publish.]]></description>
			<content:encoded><![CDATA[<p>std::forward(args&#8230;) is wrong.<br />
std::forward(args)&#8230; is correct.<br />
Don&#8217;t forget to compile the code you publish.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Risto Lankinen		</title>
		<link>https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/#comment-619</link>

		<dc:creator><![CDATA[Risto Lankinen]]></dc:creator>
		<pubDate>Fri, 27 Oct 2017 16:18:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1658#comment-619</guid>

					<description><![CDATA[How about...

using newId = newIdFromDatabase;

... ?]]></description>
			<content:encoded><![CDATA[<p>How about&#8230;</p>
<p>using newId = newIdFromDatabase;</p>
<p>&#8230; ?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
