Boost C++ Libraries: Ticket #6222: Compile error with SunStudio: unique_future move https://svn.boost.org/trac10/ticket/6222 <pre class="wiki">// B.cpp #include &lt;boost/thread.hpp&gt; static int function() { return 42; } int main(int argc, const char *argv[]) { boost::packaged_task&lt;int&gt; pt(function); boost::unique_future&lt;int&gt; future = pt.get_future(); return 0; } </pre><p> When trying to compile this I get this error: </p> <p> "B.cpp", line 10: Error: boost::unique_future&lt;int&gt;::unique_future(boost::unique_future&lt;int&gt;&amp;) is not accessible from main(int, const char<strong>). 1 Error(s) detected. </strong></p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6222 Trac 1.4.3 anonymous Tue, 06 Dec 2011 08:32:47 GMT <link>https://svn.boost.org/trac10/ticket/6222#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6222#comment:1</guid> <description> <p> Version of compiler: CC: Sun C++ 5.10 SunOS_sparc 2009/06/03 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 07 Dec 2011 09:12:43 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/6222#comment:2 https://svn.boost.org/trac10/ticket/6222#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Anthony Williams</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">thread</span> </li> </ul> Ticket viboes Sat, 10 Dec 2011 15:35:04 GMT summary changed https://svn.boost.org/trac10/ticket/6222#comment:3 https://svn.boost.org/trac10/ticket/6222#comment:3 <ul> <li><strong>summary</strong> <span class="trac-field-old">Compile error with SunStudio</span> → <span class="trac-field-new">Compile error with SunStudio: unique_future move</span> </li> </ul> Ticket viboes Sun, 11 Dec 2011 14:16:41 GMT cc, keywords set https://svn.boost.org/trac10/ticket/6222#comment:4 https://svn.boost.org/trac10/ticket/6222#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> <li><strong>keywords</strong> move added </li> </ul> <p> There is an action point to use Boost.Move. Could we consider this as a duplicate of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6194" title="#6194: Feature Requests: Adapt to Boost.Move (closed: fixed)">#6194</a> Adapt to Boost.Move. </p> Ticket viboes Sat, 07 Jan 2012 23:49:36 GMT owner, status changed https://svn.boost.org/trac10/ticket/6222#comment:5 https://svn.boost.org/trac10/ticket/6222#comment:5 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket viboes Wed, 21 Mar 2012 01:35:02 GMT <link>https://svn.boost.org/trac10/ticket/6222#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6222#comment:6</guid> <description> <p> The current implementation doesn't works on <a class="missing wiki">SunStudio</a> as it is preferring the overload to the private constructor instead of the conversion. </p> <p> I have added a move() member function that should help to force the conversion in trunk. You can add the following </p> <pre class="wiki"> boost::detail::thread_move_t&lt;unique_future&gt; move() { return boost::detail::thread_move_t&lt;unique_future&gt;(*this); } </pre><p> Could you try this </p> <pre class="wiki"> boost::unique_future&lt;int&gt; future = pt.get_future().move(); </pre><p> </p> <p> Let me now if this work for you. I will add some documentation explaining the limitation on <a class="missing wiki">SunStudio</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 02 Apr 2012 16:42:23 GMT</pubDate> <title>severity, milestone changed https://svn.boost.org/trac10/ticket/6222#comment:7 https://svn.boost.org/trac10/ticket/6222#comment:7 <ul> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Problem</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.50.0</span> </li> </ul> Ticket viboes Mon, 28 May 2012 15:45:01 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6222#comment:8 https://svn.boost.org/trac10/ticket/6222#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Committed in release branch at <a class="changeset" href="https://svn.boost.org/trac10/changeset/78543" title="Merged boost.thread from trunk">[78543]</a> </p> Ticket