Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) unused parameter 'seq'

 

Compile warning.

 

 

 

 

 

Full warning message

 

/MyFolder/MyProject/../../../boost_1_42_0/boost/fusion/container/vector/detail/vector_n_chooser.hpp:14: In file included from ../../../boost_1_42_0/boost/fusion/container/vector/detail/vector_n_chooser.hpp:14,
/MyFolder/MyProject/../../../boost_1_42_0/boost/fusion/container/vector/vector.hpp:11: from ../../../boost_1_42_0/boost/fusion/container/vector/vector.hpp:11,
/MyFolder/MyProject/../../../boost_1_42_0/boost/fusion/tuple/tuple.hpp:11: from ../../../boost_1_42_0/boost/fusion/tuple/tuple.hpp:11,
/MyFolder/MyProject/../../../boost_1_42_0/boost/fusion/tuple.hpp:10: from ../../../boost_1_42_0/boost/fusion/tuple.hpp:10,
/MyFolder/MyProject/../../../boost_1_42_0/boost/fusion/include/tuple.hpp:10: from ../../../boost_1_42_0/boost/fusion/include/tuple.hpp:10,
/MyFolder/MyProject/../../../boost_1_42_0/boost/tr1/tuple.hpp:58: from ../../../boost_1_42_0/boost/tr1/tuple.hpp:58,
/MyFolder/MyProject/../../../boost_1_42_0/boost/math/special_functions/detail/igamma_inverse.hpp:13: from ../../../boost_1_42_0/boost/math/special_functions/detail/igamma_inverse.hpp:13,
/MyFolder/MyProject/../../../boost_1_42_0/boost/math/special_functions/gamma.hpp:1528: from ../../../boost_1_42_0/boost/math/special_functions/gamma.hpp:1528,
/MyFolder/MyProject/../../../boost_1_42_0/boost/math/special_functions/beta.hpp:15: from ../../../boost_1_42_0/boost/math/special_functions/beta.hpp:15,
/MyFolder/MyProject/../../../boost_1_42_0/boost/math/distributions/students_t.hpp:14: from ../../../boost_1_42_0/boost/math/distributions/students_t.hpp:14,
/MyFolder/MyProject/main.cpp:1: from main.cpp:1:
/MyFolder/MyProject/../../../boost_1_42_0/boost/fusion/container/vector/vector.hpp:62: instantiated from 'boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::vector(const Sequence&) [with Sequence = boost::fusion::tuple<boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>, T0 = boost::fusion::void_, T1 = boost::fusion::void_, T2 = boost::fusion::void_, T3 = boost::fusion::void_, T4 = boost::fusion::void_, T5 = boost::fusion::void_, T6 = boost::fusion::void_, T7 = boost::fusion::void_, T8 = boost::fusion::void_, T9 = boost::fusion::void_]'
/MyFolder/MyProject/../../../boost_1_42_0/boost/fusion/tuple/make_tuple.hpp:22: instantiated from here
/MyFolder/MyProject/../../../boost_1_42_0/boost/fusion/tuple/make_tuple.hpp:22: instantiated from here
/MyFolder/MyProject/../../../boost_1_42_0/boost/fusion/container/vector/vector10.hpp:55: warning: unused parameter 'seq'

 

 

 

 

 

Cause

 

#include <boost/math/distributions/students_t.hpp>

 

Which takes you to the following line in 'boost/fusion/container/vector/vector10.hpp':

 

/*=============================================================================
    Copyright (c) 2001-2006 Joel de Guzman

    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_VECTOR10_05042005_0257)
#define FUSION_VECTOR10_05042005_0257

#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/container/vector/detail/at_impl.hpp>
#include <boost/fusion/container/vector/detail/value_at_impl.hpp>
#include <boost/fusion/container/vector/detail/begin_impl.hpp>
#include <boost/fusion/container/vector/detail/end_impl.hpp>

#include <boost/mpl/void.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/vector/vector10.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/utility/enable_if.hpp>

#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/iteration/iterate.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_shifted.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>

namespace boost { namespace fusion
{
    struct vector_tag;
    struct fusion_sequence_tag;
    struct random_access_traversal_tag;

    template <typename Dummy = void>
    struct vector0 : sequence_base<vector0<Dummy> >
    {
        typedef mpl::vector0<> types;
        typedef vector_tag fusion_tag;
        typedef fusion_sequence_tag tag; // this gets picked up by MPL
        typedef mpl::false_ is_view;
        typedef random_access_traversal_tag category;
        typedef mpl::int_<0> size;

        vector0() {}

        template<typename Sequence>
        vector0(Sequence const& seq) //This line
        {}
    };

// expand vector1 to vector10
#define BOOST_PP_FILENAME_1 <boost/fusion/container/vector/detail/vector_n.hpp>
#define BOOST_PP_ITERATION_LIMITS (1, 10)
#include BOOST_PP_ITERATE()

}}

#endif

 

IDE: Qt Creator 1.3.1

Project type: Qt4 Console Application

Selected required modules: QtCore

Compiler: G++ 4.4.1

Boost version: 1.42.0

 

 

 

 

 

Solution

 

The compiler is right: seq is an unused variable. I changed the code to

 

/*=============================================================================
    Copyright (c) 2001-2006 Joel de Guzman

    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_VECTOR10_05042005_0257)
#define FUSION_VECTOR10_05042005_0257

#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/container/vector/detail/at_impl.hpp>
#include <boost/fusion/container/vector/detail/value_at_impl.hpp>
#include <boost/fusion/container/vector/detail/begin_impl.hpp>
#include <boost/fusion/container/vector/detail/end_impl.hpp>

#include <boost/mpl/void.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/vector/vector10.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/utility/enable_if.hpp>

#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/iteration/iterate.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_shifted.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>

namespace boost { namespace fusion
{
    struct vector_tag;
    struct fusion_sequence_tag;
    struct random_access_traversal_tag;

    template <typename Dummy = void>
    struct vector0 : sequence_base<vector0<Dummy> >
    {
        typedef mpl::vector0<> types;
        typedef vector_tag fusion_tag;
        typedef fusion_sequence_tag tag; // this gets picked up by MPL
        typedef mpl::false_ is_view;
        typedef random_access_traversal_tag category;
        typedef mpl::int_<0> size;

        vector0() {}

        template<typename Sequence>
        vector0(Sequence const&) //This line
        {}
    };

// expand vector1 to vector10
#define BOOST_PP_FILENAME_1 <boost/fusion/container/vector/detail/vector_n.hpp>
#define BOOST_PP_ITERATION_LIMITS (1, 10)
#include BOOST_PP_ITERATE()

}}

#endif

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict