Boost C++ Libraries: Ticket #13037: <boost/variant/polymorphic_get.hpp> is missing include <boost/type_traits/is_const.hpp> https://svn.boost.org/trac10/ticket/13037 <p> Trivial demonstration can be made by preparing a source file containing nothing but an inclusion of the <code>polymorphic_get.hpp</code>: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/variant/polymorphic_get.hpp&gt;</span><span class="cp"></span> </pre></div></div><p> on GCC 6.3 with options <code>-Wall -Wextra -std=c++14</code> compiling such file produces errors: </p> <pre class="wiki">In file included from Test.cpp:1:0: /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp: In member function ‘boost::detail::variant::get_polymorphic_visitor&lt;Base&gt;::pointer boost::detail::variant::get_polymorphic_visitor&lt;Base&gt;::operator()(U&amp;) const’: /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:18: error: ‘is_const’ is not a member of ‘boost’ (boost::is_const&lt;base_t&gt;::value || !boost::is_const&lt;U&gt;::value) ^~~~~ /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:18: note: suggested alternative: In file included from /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/include/c++/bits/move.h:57:0, from /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/include/c++/bits/nested_exception.h:40, from /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/include/c++/exception:171, from /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:15, from Test.cpp:1: /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/include/c++/type_traits:652:12: note: ‘std::is_const’ struct is_const ^~~~~~~~ In file included from Test.cpp:1:0: /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:41: error: ‘::value’ has not been declared (boost::is_const&lt;base_t&gt;::value || !boost::is_const&lt;U&gt;::value) ^~ /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:53: error: ‘is_const’ is not a member of ‘boost’ (boost::is_const&lt;base_t&gt;::value || !boost::is_const&lt;U&gt;::value) ^~~~~ /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:53: note: suggested alternative: In file included from /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/include/c++/bits/move.h:57:0, from /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/include/c++/bits/nested_exception.h:40, from /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/include/c++/exception:171, from /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:15, from Test.cpp:1: /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/include/c++/type_traits:652:12: note: ‘std::is_const’ struct is_const ^~~~~~~~ In file included from Test.cpp:1:0: /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:68: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] (boost::is_const&lt;base_t&gt;::value || !boost::is_const&lt;U&gt;::value) ^ /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:71: error: ‘::value’ has not been declared (boost::is_const&lt;base_t&gt;::value || !boost::is_const&lt;U&gt;::value) ^~ /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:125:9: error: template argument 2 is invalid &gt; tag_t; ^ </pre><p> Workaround it trivial - one needs to include <code>is_const.hpp</code> before including <code>polymorphic_get.hpp</code>: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/type_traits/is_const.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/variant/polymorphic_get.hpp&gt;</span><span class="cp"></span> </pre></div></div> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13037 Trac 1.4.3 Adam Badura <adam.f.badura@…> Fri, 19 May 2017 07:05:52 GMT <link>https://svn.boost.org/trac10/ticket/13037#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13037#comment:1</guid> <description> <p> I have prepared correction for this bug and issues a pull request with it (<a class="ext-link" href="https://github.com/boostorg/variant/pull/32"><span class="icon">​</span>https://github.com/boostorg/variant/pull/32</a>). </p> </description> <category>Ticket</category> </item> <item> <author>Adam Badura <adam.f.badura@…></author> <pubDate>Fri, 19 May 2017 07:08:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13037#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13037#comment:2</guid> <description> <p> Note however that it seems <code>polymorphic_get.hpp</code> header has more such issues: use of elements that are not directly included. Among others there is <code>boost::remove_cv</code> - a problem mentioned in ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/11283" title="#11283: Bugs: Variant: Missing include in element_index.hpp (closed: fixed)">#11283</a>. </p> <p> Should they be solved as well? </p> <p> At least as for now they are not causing compilation errors. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Fri, 19 May 2017 19:00:30 GMT</pubDate> <title>owner, status, milestone changed https://svn.boost.org/trac10/ticket/13037#comment:3 https://svn.boost.org/trac10/ticket/13037#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">ebf</span> to <span class="trac-author">Antony Polukhin</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.65.0</span> </li> </ul> <p> Fixed by Adam Badura in <a class="ext-link" href="https://github.com/boostorg/variant/commit/76b592ae1f8411eefd425bcf1a38c300dd8032b5"><span class="icon">​</span>76b592ae</a> and was merged into the develop in <a class="ext-link" href="https://github.com/boostorg/variant/commit/575c5796b484927827a912f03700cfa465cc7df5"><span class="icon">​</span>575c5796</a>. </p> <p> Will be merged to the master branch as soon as the regression tests cycle. </p> Ticket Antony Polukhin Tue, 26 Sep 2017 18:08:11 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/13037#comment:4 https://svn.boost.org/trac10/ticket/13037#comment:4 <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> Ticket