Boost C++ Libraries: Ticket #12563: Assigning to boost::optional<std::tuple from std::tuple fails to compile using c++14 and libc++. https://svn.boost.org/trac10/ticket/12563 <pre class="wiki">#include &lt;boost/optional.hpp&gt; #include &lt;tuple&gt; using Tup = std::tuple&lt;boost::optional&lt;int&gt;&gt;; Tup x; boost::optional&lt;Tup&gt; y = x; </pre><p> when compiled with: clang++-3.7 -std=c++14 -stdlib=libc++ temp.cpp fails to compile: </p> <pre class="wiki">error: no matching member function for call to 'construct' this-&gt;construct( boost::move(rhs.get()) ); ~~~~~~^~~~~~~~~ /usr/include/c++/v1/tuple:220:15: note: in instantiation of function template specialization 'boost::optional&lt;int&gt;::optional&lt;std::__1::tuple&lt;boost::optional&lt;int&gt; &gt; &gt;' requested here : value(_VSTD::forward&lt;_Tp&gt;(__t)) ^ /path/boost/1.62.0a-src/boost/boost/optional/optional.hpp:348:10: note: candidate function not viable: no known conversion from 'typename ::boost::move_detail::remove_reference&lt;tuple&lt;optional&lt;int&gt; &gt; &amp;&gt;::type' (aka 'std::__1::tuple&lt;boost::optional&lt;int&gt; &gt;') to 'const int' for 1st argument void construct ( argument_type val ) ^ /path/boost/1.62.0a-src/boost/boost/optional/optional.hpp:355:10: note: candidate function not viable: no known conversion from 'typename ::boost::move_detail::remove_reference&lt;tuple&lt;optional&lt;int&gt; &gt; &amp;&gt;::type' (aka 'std::__1::tuple&lt;boost::optional&lt;int&gt; &gt;') to 'int' for 1st argument void construct ( rval_reference_type val ) ^ /path/boost/1.62.0a-src/boost/boost/optional/optional.hpp:367:10: note: candidate function [with Args = &lt;&gt;] not viable: no known conversion from 'typename ::boost::move_detail::remove_reference&lt;tuple&lt;optional&lt;int&gt; &gt; &amp;&gt;::type' (aka 'std::__1::tuple&lt;boost::optional&lt;int&gt; &gt;') to 'boost::optional_ns::in_place_init_t' for 1st argument void construct ( in_place_init_t, Args&amp;&amp;... args ) ^ /path/boost/1.62.0a-src/boost/boost/optional/optional.hpp:544:10: note: candidate function template not viable: requires 2 arguments, but 1 was provided void construct ( Expr&amp;&amp; factory, in_place_factory_base const* ) ^ /path/boost/1.62.0a-src/boost/boost/optional/optional.hpp:552:10: note: candidate function template not viable: requires 2 arguments, but 1 was provided void construct ( Expr&amp;&amp; factory, typed_in_place_factory_base const* ) ^ /path/boost/1.62.0a-src/boost/boost/optional/optional.hpp:614:10: note: candidate function template not viable: requires 2 arguments, but 1 was provided void construct ( Expr&amp;&amp; expr, void const* ) </pre><p> Compiling with -std=c++11 and -stdlib=libc++ compiles fine. Compiling with -std=c++14 and -stdlib=libstdc++ compiles fine. Using std::experimental::optional instead of boost::optional compiles fine. Using boost::tuple instead of libc++ std::tuple compiles fine. </p> <p> So it seems to only be libc++ libc++ tuple with boost::optional and c++14. I am not sure the bug is actually a boost::optional bug, (it may be libc++ or clang) so if this is incorrect please let me know. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12563 Trac 1.4.3 akrzemi1 Tue, 08 Nov 2016 20:41:55 GMT <link>https://svn.boost.org/trac10/ticket/12563#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12563#comment:1</guid> <description> <p> Can you still see the bug after my latest commit? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>akrzemi1</dc:creator> <pubDate>Wed, 09 Nov 2016 14:40:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12563#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12563#comment:2</guid> <description> <p> Unfortunately, I do not have access to such tuple's source code. Could you send me your tuple header: /usr/include/c++/v1/tuple </p> </description> <category>Ticket</category> </item> <item> <author>eurokang@…</author> <pubDate>Tue, 15 Nov 2016 05:48:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12563#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12563#comment:3</guid> <description> <p> Yes, the bug still exists after using latest git version of boost::optional. </p> <p> <a class="ext-link" href="http://llvm.org/svn/llvm-project/libcxx/trunk/include/tuple"><span class="icon">​</span>http://llvm.org/svn/llvm-project/libcxx/trunk/include/tuple</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>akrzemi1</dc:creator> <pubDate>Sat, 19 Nov 2016 14:00:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12563#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12563#comment:4</guid> <description> <p> Ok, I think I know where the problem is. I have just pushed a commit to branch develop (hash 7ea2ca6). Could you verify if this fixes the problem for you? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 24 Nov 2016 00:00:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12563#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12563#comment:5</guid> <description> <p> Yes, that fixes it! Thanks! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>akrzemi1</dc:creator> <pubDate>Thu, 24 Nov 2016 22:36:20 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/12563#comment:6 https://svn.boost.org/trac10/ticket/12563#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.63.0</span> </li> </ul> Ticket