我有一个结构,其目的是在列表中获取下一个int类型(只需复制和粘贴):
#ifndef PROMOTE_H_INCLUDED
#define PROMOTE_H_INCLUDED
#include <type_traits>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/find.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/deref.hpp>
template<class Int_T>
struct Is_Char
{
enum {value = false};
};
template<>
struct Is_Char<char>
{
enum {value = true};
};
template<>
struct Is_Char<unsigned char>
{
enum {value = true};
};
template<>
struct Is_Char<signed char>
{
enum {value = true};
};
template<class Integral>
struct Promote
{
static_assert(std::is_integral<Integral>::value,"Non integral type is not allowed.");
typedef typename std::conditional<std::is_signed<Integral>::value,
boost::mpl::vector<char,short,int,long,long long>,
boost::mpl::vector<unsigned char,unsigned short,unsigned int,unsigned long, unsigned long long>>::type types;
typedef typename boost::mpl::find<types,
typename std::conditional<Is_Char<Integral>::value,
typename std::conditional<std::is_signed<Integral>::value,char,unsigned char>::type, Integral>::type>::type this_type;
typedef typename boost:: mpl::next<this_type>::type next_type;
typedef typename boost::mpl::deref<next_type>::type type;
};
#endif // PROMOTE_H_INCLUDED
当我尝试使用VS编译它时,它可以工作,但不会使用gcc 4.6.1编译:
#include <iostream>
#include "Promote.h"
using namespace std;
int main()
{
cout << typeid(Promote<char>::type).name();
return 0;
}
我从gcc那里得到错误,提示有什么问题(它甚至没有说出错误是什么):
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:81|12|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>::result_'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:104|11|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find_if.hpp:39|17|instantiated from 'boost::mpl::find_if<boost::mpl::vector<char, short int, int, long int, long long int>, boost::mpl::same_as<char> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find.hpp:28|8|instantiated from 'boost::mpl::find<boost::mpl::vector<char, short int, int, long int, long long int>, char>'|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:39|113|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\and.hpp|17|warning: base class 'struct mpl_::bool_<false>' has a non-virtual destructor [-Weffc++]|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\and.hpp:48|8|instantiated from 'boost::mpl::and_<boost::mpl::not_<boost::is_same<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> > >, boost::mpl::apply1<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:40|58|instantiated from 'boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >::apply<void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply_wrap.hpp:46|8|instantiated from 'boost::mpl::apply_wrap2<boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply.hpp:67|8|instantiated from 'boost::mpl::apply2<boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:62|63|instantiated from 'boost::mpl::aux::iter_fold_if_forward_step<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:101|135|instantiated from 'boost::mpl::aux::iter_fold_if_impl<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, mpl_::na, boost::mpl::always<mpl_::bool_<false> > >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:81|12|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>::result_'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:104|11|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find_if.hpp:39|17|instantiated from 'boost::mpl::find_if<boost::mpl::vector<char, short int, int, long int, long long int>, boost::mpl::same_as<char> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find.hpp:28|8|instantiated from 'boost::mpl::find<boost::mpl::vector<char, short int, int, long int, long long int>, char>'|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:39|113|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\and.hpp|23|warning: base class 'struct boost::mpl::aux::and_impl<false, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >' has a non-virtual destructor [-Weffc++]|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:40|58|instantiated from 'boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >::apply<void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply_wrap.hpp:46|8|instantiated from 'boost::mpl::apply_wrap2<boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply.hpp:67|8|instantiated from 'boost::mpl::apply2<boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:62|63|instantiated from 'boost::mpl::aux::iter_fold_if_forward_step<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:101|135|instantiated from 'boost::mpl::aux::iter_fold_if_impl<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, mpl_::na, boost::mpl::always<mpl_::bool_<false> > >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:81|12|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>::result_'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:104|11|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find_if.hpp:39|17|instantiated from 'boost::mpl::find_if<boost::mpl::vector<char, short int, int, long int, long long int>, boost::mpl::same_as<char> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find.hpp:28|8|instantiated from 'boost::mpl::find<boost::mpl::vector<char, short int, int, long int, long long int>, char>'|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:39|113|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\and.hpp|48|warning: base class 'struct boost::mpl::aux::and_impl<true, boost::mpl::apply1<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >' has a non-virtual destructor [-Weffc++]|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply_wrap.hpp:46|8|instantiated from 'boost::mpl::apply_wrap2<boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply.hpp:67|8|instantiated from 'boost::mpl::apply2<boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:62|63|instantiated from 'boost::mpl::aux::iter_fold_if_forward_step<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:101|135|instantiated from 'boost::mpl::aux::iter_fold_if_impl<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, mpl_::na, boost::mpl::always<mpl_::bool_<false> > >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:81|12|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>::result_'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:104|11|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find_if.hpp:39|17|instantiated from 'boost::mpl::find_if<boost::mpl::vector<char, short int, int, long int, long long int>, boost::mpl::same_as<char> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find.hpp:28|8|instantiated from 'boost::mpl::find<boost::mpl::vector<char, short int, int, long int, long long int>, char>'|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:39|113|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp|40|warning: base class 'struct boost::mpl::and_<boost::mpl::not_<boost::is_same<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> > >, boost::mpl::apply1<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<tru|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply.hpp:67|8|instantiated from 'boost::mpl::apply2<boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:62|63|instantiated from 'boost::mpl::aux::iter_fold_if_forward_step<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:101|135|instantiated from 'boost::mpl::aux::iter_fold_if_impl<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, mpl_::na, boost::mpl::always<mpl_::bool_<false> > >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:81|12|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>::result_'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:104|11|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find_if.hpp:39|17|instantiated from 'boost::mpl::find_if<boost::mpl::vector<char, short int, int, long int, long long int>, boost::mpl::same_as<char> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find.hpp:28|8|instantiated from 'boost::mpl::find<boost::mpl::vector<char, short int, int, long int, long long int>, char>'|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:39|113|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply_wrap.hpp|46|warning: base class 'struct boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >::apply<void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >' has a non-virtual destructor [-Weffc++]|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:62|63|instantiated from 'boost::mpl::aux::iter_fold_if_forward_step<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:101|135|instantiated from 'boost::mpl::aux::iter_fold_if_impl<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, mpl_::na, boost::mpl::always<mpl_::bool_<false> > >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:81|12|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>::result_'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:104|11|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find_if.hpp:39|17|instantiated from 'boost::mpl::find_if<boost::mpl::vector<char, short int, int, long int, long long int>, boost::mpl::same_as<char> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find.hpp:28|8|instantiated from 'boost::mpl::find<boost::mpl::vector<char, short int, int, long int, long long int>, char>'|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:39|113|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply.hpp|67|warning: base class 'struct boost::mpl::apply_wrap2<boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >' has a non-virtual destructor [-Weffc++]|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply.hpp:67|8|instantiated from 'boost::mpl::apply2<boost::mpl::always<mpl_::bool_<false> >, void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:79|63|instantiated from 'boost::mpl::aux::iter_fold_if_backward_step<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::na, boost::mpl::always<mpl_::bool_<false> > >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:123|139|instantiated from 'boost::mpl::aux::iter_fold_if_impl<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, mpl_::na, boost::mpl::always<mpl_::bool_<false> > >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:81|12|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>::result_'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:104|11|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find_if.hpp:39|17|instantiated from 'boost::mpl::find_if<boost::mpl::vector<char, short int, int, long int, long long int>, boost::mpl::same_as<char> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find.hpp:28|8|instantiated from 'boost::mpl::find<boost::mpl::vector<char, short int, int, long int, long long int>, char>'|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:39|113|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply_wrap.hpp|46|warning: base class 'struct boost::mpl::always<mpl_::bool_<false> >::apply<void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >' has a non-virtual destructor [-Weffc++]|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:79|63|instantiated from 'boost::mpl::aux::iter_fold_if_backward_step<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::na, boost::mpl::always<mpl_::bool_<false> > >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\iter_fold_if_impl.hpp:123|139|instantiated from 'boost::mpl::aux::iter_fold_if_impl<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, mpl_::na, boost::mpl::always<mpl_::bool_<false> > >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:81|12|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>::result_'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:104|11|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find_if.hpp:39|17|instantiated from 'boost::mpl::find_if<boost::mpl::vector<char, short int, int, long int, long long int>, boost::mpl::same_as<char> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find.hpp:28|8|instantiated from 'boost::mpl::find<boost::mpl::vector<char, short int, int, long int, long long int>, char>'|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:39|113|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\aux_\preprocessed\gcc\apply.hpp|67|warning: base class 'struct boost::mpl::apply_wrap2<boost::mpl::always<mpl_::bool_<false> >, void, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l> >' has a non-virtual destructor [-Weffc++]|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp:104|11|instantiated from 'boost::mpl::iter_fold_if<boost::mpl::vector<char, short int, int, long int, long long int>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, mpl_::na, mpl_::na>'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find_if.hpp:39|17|instantiated from 'boost::mpl::find_if<boost::mpl::vector<char, short int, int, long int, long long int>, boost::mpl::same_as<char> >'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find.hpp:28|8|instantiated from 'boost::mpl::find<boost::mpl::vector<char, short int, int, long int, long long int>, char>'|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:39|113|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\iter_fold_if.hpp|81|warning: base class 'struct boost::mpl::aux::iter_fold_if_impl<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 0l>, void, mpl_::arg<1>, boost::mpl::protect<boost::mpl::aux::iter_fold_if_pred<boost::mpl::protect<boost::mpl::aux::find_if_pred<boost::mpl::same_as<char> >, 0>, boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 5l> >, 0>, mpl_::na, boost::mpl::always<mpl_::bool_<false> > >' has a non-virtual destructor [-Weffc++]|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:39|113|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\find.hpp|28|warning: base class 'struct boost::mpl::find_if<boost::mpl::vector<char, short int, int, long int, long long int>, boost::mpl::same_as<char> >' has a non-virtual destructor [-Weffc++]|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\vector\aux_\iterator.hpp:40|44|instantiated from 'boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 1l>'|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\deref.hpp:30|37|instantiated from 'boost::mpl::deref<boost::mpl::v_iter<boost::mpl::vector<char, short int, int, long int, long long int>, 1l> >'|
C:\metaprogramming_excersizes\Just_Promote\Promote.h:41|57|instantiated from 'Promote<char>'|
C:\metaprogramming_excersizes\Just_Promote\main.cpp:8|33|instantiated from here|
D:\Libraries\boost_1_47_0\boost_1_47_0\boost\mpl\vector\aux_\at.hpp|40|warning: base class 'struct boost::mpl::aux::wrapped_type<boost::mpl::aux::type_wrapper<short int> >' has a non-virtual destructor [-Weffc++]|
||=== Build finished: 30 errors, 100 warnings (0 minutes, 22 seconds) ===|
答案 0 :(得分:4)
在第34行boost::mpl::vector<unsigned char,unsigned short,unsigned int,unsigned long, unsigned long long>>::type types;
,你有一个正确的转变,我认为你想要关闭模板。
在两个右括号之间添加一个空格应该将其排序。