<?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: When using -Ax with aC++ 6.26 function overloads with rvalue references do not bind (error #3768 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/when-using-ax-with-ac-6-26-function-overloads-with-rvalue/m-p/6323625#M496364</link>
    <description>&lt;P&gt;This was a compiler defect in A.06.26 release &amp;amp; got fixed in A.06.27 release.&lt;/P&gt;&lt;P&gt;We recommend to use latest compiler to avoid such defects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashutosh Nema |&amp;nbsp;&lt;SPAN&gt;HP-UX C/C++ Compilers Team.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jan 2014 08:38:59 GMT</pubDate>
    <dc:creator>Ashutosh_Nema</dc:creator>
    <dc:date>2014-01-06T08:38:59Z</dc:date>
    <item>
      <title>When using -Ax with aC++ 6.26 function overloads with rvalue references do not bind (error #3768).</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/when-using-ax-with-ac-6-26-function-overloads-with-rvalue/m-p/6320821#M496363</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using aC++ 6.26, the following code fails to compile.&lt;/P&gt;&lt;PRE&gt;#include &amp;lt;vector&amp;gt;

template &amp;lt;typename T&amp;gt;
class Container
{
    std::vector&amp;lt;T&amp;gt; m_container;

public:
    void add(const T &amp;amp;value)
    {
        m_container.push_back(value);
    }

    void add(T &amp;amp;&amp;amp;value)
    {
        // Cannot do this as std::move is not implemented in aC++.
        //m_container.push_back(std::move(value));
        m_container.push_back(value);
    }
};

int main()
{
    Container&amp;lt;double&amp;gt; container;
    int item = 5;
    container.add(item);
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The failure is:&lt;/P&gt;&lt;PRE&gt;"rvaluetest.cxx", line 26: error #3768: an rvalue reference cannot be bound to
          an lvalue
      container.add(item);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Which is strange, since I have overloaded the add function to take an rvalue reference as well as a const lvalue reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Surely, the compiler should pick the rvalue reference method instead of the lvalue one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To me this looks like a defect in the compiler, but is there a workaround?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2014 17:45:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/when-using-ax-with-ac-6-26-function-overloads-with-rvalue/m-p/6320821#M496363</guid>
      <dc:creator>agh</dc:creator>
      <dc:date>2014-01-02T17:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: When using -Ax with aC++ 6.26 function overloads with rvalue references do not bind (error #3768</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/when-using-ax-with-ac-6-26-function-overloads-with-rvalue/m-p/6323625#M496364</link>
      <description>&lt;P&gt;This was a compiler defect in A.06.26 release &amp;amp; got fixed in A.06.27 release.&lt;/P&gt;&lt;P&gt;We recommend to use latest compiler to avoid such defects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashutosh Nema |&amp;nbsp;&lt;SPAN&gt;HP-UX C/C++ Compilers Team.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2014 08:38:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/when-using-ax-with-ac-6-26-function-overloads-with-rvalue/m-p/6323625#M496364</guid>
      <dc:creator>Ashutosh_Nema</dc:creator>
      <dc:date>2014-01-06T08:38:59Z</dc:date>
    </item>
  </channel>
</rss>

