Dear boost developers
I used to use boost vector container with arrays like in the code below
#include
#include
#include
int main()
{
boost::fusion::vector v;
boost::fusion::at_c<1>(v) = 2;
boost::fusion::at_c<0>(v)[0] = 1; //// <----- Broken on newer boost version
}
Compiled with
g++ --std=c++11 -I/home/i-bird/BOOST_166/include -o out main.cpp
Unfortunately while this code was working under BOOST 1.63, on Boost 1.66 and Boost 1.67 it does not compile and it produce this error below. It seem that include/boost/fusion/container/vector/detail/value_at_impl.hpp went under some "modernization" process that broke the code above
Regards
Pietro
/////////////////////////// Error /////////////////////////////////////////////
In file included from /home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/at_impl.hpp:12:0,
from /home/i-bird/BOOST_166/include/boost/fusion/container/vector/vector.hpp:29,
from /home/i-bird/BOOST_166/include/boost/fusion/container/vector.hpp:12,
from main.cpp:3:
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/value_at_impl.hpp: In instantiation of ‘struct boost::fusion::extension::value_at_implboost::fusion::vector_tag::apply, mpl_::int_<0> >’:
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/at_impl.hpp:45:95: required from ‘struct boost::fusion::extension::at_implboost::fusion::vector_tag::apply, mpl_::int_<0> >’
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:66:16: required from ‘struct boost::fusion::detail::at_impl, mpl_::int_<0>, boost::fusion::vector_tag>’
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:81:16: required from ‘struct boost::fusion::result_of::at, mpl_::int_<0> >’
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:86:16: required from ‘struct boost::fusion::result_of::at_c, 0>’
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:127:5: required by substitution of ‘template constexpr typename boost::fusion::result_of::at_c::type boost::fusion::at_c(const Sequence&) [with int N = 0; Sequence = boost::fusion::vector]’
main.cpp:9:26: required from here
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/value_at_impl.hpp:53:68: error: no matching function for call to ‘value_at_impl::value>(boost::fusion::vector*)’
decltype(vector_detail::value_at_impl(boost::declval()))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/value_at_impl.hpp:38:11: note: candidate: template U boost::fusion::vector_detail::value_at_impl(const volatile boost::fusion::vector_detail::store*)
U value_at_impl(store const volatile*);
^~~~~~~~~~~~~
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/value_at_impl.hpp:38:11: note: template argument deduction/substitution failed:
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/value_at_impl.hpp:53:68: note: template argument ‘1’ does not match ‘0’
decltype(vector_detail::value_at_impl(boost::declval()))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/value_at_impl.hpp:53:68: note: template argument ‘2’ does not match ‘0’
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/value_at_impl.hpp: In substitution of ‘template U boost::fusion::vector_detail::value_at_impl(const volatile boost::fusion::vector_detail::store*) [with long unsigned int N = 0; U = int [3]]’:
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/value_at_impl.hpp:53:68: required from ‘struct boost::fusion::extension::value_at_implboost::fusion::vector_tag::apply, mpl_::int_<0> >’
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/at_impl.hpp:45:95: required from ‘struct boost::fusion::extension::at_implboost::fusion::vector_tag::apply, mpl_::int_<0> >’
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:66:16: required from ‘struct boost::fusion::detail::at_impl, mpl_::int_<0>, boost::fusion::vector_tag>’
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:81:16: required from ‘struct boost::fusion::result_of::at, mpl_::int_<0> >’
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:86:16: required from ‘struct boost::fusion::result_of::at_c, 0>’
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:127:5: required by substitution of ‘template constexpr typename boost::fusion::result_of::at_c::type boost::fusion::at_c(const Sequence&) [with int N = 0; Sequence = boost::fusion::vector]’
main.cpp:9:26: required from here
/home/i-bird/BOOST_166/include/boost/fusion/container/vector/detail/value_at_impl.hpp:38:11: error: function returning an array
U value_at_impl(store const volatile*);
^~~~~~~~~~~~~
main.cpp: In function ‘int main()’:
main.cpp:9:26: error: no matching function for call to ‘at_c<0>(boost::fusion::vector&)’
boost::fusion::at_c<0>(v)[0] = 1;
^
In file included from main.cpp:1:0:
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:119:5: note: candidate: template constexpr typename boost::lazy_disable_if >::type boost::fusion::at_c(Sequence&)
at_c(Sequence& seq)
^~~~
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:119:5: note: template argument deduction/substitution failed:
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:127:5: note: candidate: template constexpr typename boost::fusion::result_of::at_c::type boost::fusion::at_c(const Sequence&)
at_c(Sequence const& seq)
^~~~
/home/i-bird/BOOST_166/include/boost/fusion/sequence/intrinsic/at.hpp:127:5: note: substitution of deduced template arguments resulted in errors seen above
[i-bird@localhost boost_bug_test]$
[i-bird@localhost boost_bug_test]$
[i-bird@localhost boost_bug_test]$
[i-bird@localhost boost_bug_test]$ g++ --std=c++11 -I/home/i-bird/BOOST_167/include -o out main.cpp
In file included from /home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/at_impl.hpp:12:0,
from /home/i-bird/BOOST_167/include/boost/fusion/container/vector/vector.hpp:29,
from /home/i-bird/BOOST_167/include/boost/fusion/container/vector.hpp:12,
from main.cpp:3:
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/value_at_impl.hpp: In instantiation of ‘struct boost::fusion::extension::value_at_implboost::fusion::vector_tag::apply, mpl_::int_<0> >’:
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/at_impl.hpp:45:95: required from ‘struct boost::fusion::extension::at_implboost::fusion::vector_tag::apply, mpl_::int_<0> >’
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:66:16: required from ‘struct boost::fusion::detail::at_impl, mpl_::int_<0>, boost::fusion::vector_tag>’
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:81:16: required from ‘struct boost::fusion::result_of::at, mpl_::int_<0> >’
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:86:16: required from ‘struct boost::fusion::result_of::at_c, 0>’
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:127:5: required by substitution of ‘template constexpr typename boost::fusion::result_of::at_c::type boost::fusion::at_c(const Sequence&) [with int N = 0; Sequence = boost::fusion::vector]’
main.cpp:9:26: required from here
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/value_at_impl.hpp:53:68: error: no matching function for call to ‘value_at_impl::value>(boost::fusion::vector*)’
decltype(vector_detail::value_at_impl(boost::declval()))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/value_at_impl.hpp:38:11: note: candidate: template U boost::fusion::vector_detail::value_at_impl(const volatile boost::fusion::vector_detail::store*)
U value_at_impl(store const volatile*);
^~~~~~~~~~~~~
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/value_at_impl.hpp:38:11: note: template argument deduction/substitution failed:
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/value_at_impl.hpp:53:68: note: template argument ‘1’ does not match ‘0’
decltype(vector_detail::value_at_impl(boost::declval()))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/value_at_impl.hpp:53:68: note: template argument ‘2’ does not match ‘0’
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/value_at_impl.hpp: In substitution of ‘template U boost::fusion::vector_detail::value_at_impl(const volatile boost::fusion::vector_detail::store*) [with long unsigned int N = 0; U = int [3]]’:
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/value_at_impl.hpp:53:68: required from ‘struct boost::fusion::extension::value_at_implboost::fusion::vector_tag::apply, mpl_::int_<0> >’
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/at_impl.hpp:45:95: required from ‘struct boost::fusion::extension::at_implboost::fusion::vector_tag::apply, mpl_::int_<0> >’
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:66:16: required from ‘struct boost::fusion::detail::at_impl, mpl_::int_<0>, boost::fusion::vector_tag>’
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:81:16: required from ‘struct boost::fusion::result_of::at, mpl_::int_<0> >’
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:86:16: required from ‘struct boost::fusion::result_of::at_c, 0>’
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:127:5: required by substitution of ‘template constexpr typename boost::fusion::result_of::at_c::type boost::fusion::at_c(const Sequence&) [with int N = 0; Sequence = boost::fusion::vector]’
main.cpp:9:26: required from here
/home/i-bird/BOOST_167/include/boost/fusion/container/vector/detail/value_at_impl.hpp:38:11: error: function returning an array
U value_at_impl(store const volatile*);
^~~~~~~~~~~~~
main.cpp: In function ‘int main()’:
main.cpp:9:26: error: no matching function for call to ‘at_c<0>(boost::fusion::vector&)’
boost::fusion::at_c<0>(v)[0] = 1;
^
In file included from main.cpp:1:0:
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:119:5: note: candidate: template constexpr typename boost::lazy_disable_if >::type boost::fusion::at_c(Sequence&)
at_c(Sequence& seq)
^~~~
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:119:5: note: template argument deduction/substitution failed:
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:127:5: note: candidate: template constexpr typename boost::fusion::result_of::at_c::type boost::fusion::at_c(const Sequence&)
at_c(Sequence const& seq)
^~~~
/home/i-bird/BOOST_167/include/boost/fusion/sequence/intrinsic/at.hpp:127:5: note: substitution of deduced template arguments resulted in errors seen above