Boost C++ Libraries: Ticket #7934: tuples::element returns wrong typesss for bolatile tuples https://svn.boost.org/trac10/ticket/7934 <p> Hi, </p> <p> according to c++11, volatile tuples should return volatile elements. I think, boost tuple should behave similarly, however it doesn't. </p> <p> Below is an example with two tests, one test for boost tuple and one for standard tuple. The boost tuple test fails. </p> <pre class="wiki">// file a.cpp #define BOOST_TEST_MODULE example #include &lt;boost/test/included/unit_test.hpp&gt; #include &lt;boost/type_traits.hpp&gt; #include &lt;boost/tuple/tuple.hpp&gt; #include &lt;tuple&gt; BOOST_AUTO_TEST_CASE( boost_tuple ) { using boost::is_same; using boost::tuple; using boost::tuples::element; typedef element&lt;0, volatile tuple&lt;int&gt; &gt; VElement; typedef element&lt;0, const volatile tuple&lt;int&gt; &gt; CVElement; BOOST_CHECK((is_same&lt;typename VElement::type, volatile int&gt;::value)); BOOST_CHECK((is_same&lt;typename CVElement::type, const volatile int&gt;::value)); } BOOST_AUTO_TEST_CASE( std_tuple ) { using boost::is_same; using std::tuple; using std::tuple_element; typedef tuple_element&lt;0, volatile tuple&lt;int&gt; &gt; VElement; typedef tuple_element&lt;0, const volatile tuple&lt;int&gt; &gt; CVElement; BOOST_CHECK((is_same&lt;typename VElement::type, volatile int&gt;::value)); BOOST_CHECK((is_same&lt;typename CVElement::type, const volatile int&gt;::value)); } </pre><pre class="wiki">ptomulik@barakus$ g++ -ansi -std=c++11 -Werror -Wall -Wextra -pedantic a.cpp ptomulik@barakus$ ./a.out Running 2 test cases... a.cpp(15): error in "boost_tuple": check (is_same&lt;typename VElement::type, volatile int&gt;::value) failed a.cpp(16): error in "boost_tuple": check (is_same&lt;typename CVElement::type, const volatile int&gt;::value) failed *** 2 failures detected in test suite "example" </pre><p> my gcc version </p> <pre class="wiki">ptomulik@barakus:$ g++ --version g++ (Debian 4.7.2-5) 4.7.2 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7934 Trac 1.4.3 Joel de Guzman Mon, 28 Jan 2013 03:34:46 GMT <link>https://svn.boost.org/trac10/ticket/7934#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7934#comment:1</guid> <description> <p> I am not really the maintainer of Boost Tuple so I can't do anything about it. I can, however, make sure that Fusion gets this correctly. </p> </description> <category>Ticket</category> </item> </channel> </rss>