' boost :: detail :: variant :: visitation_impl':2个重载中没有一个可以转换所有的参数类型

时间:2016-08-10 07:20:50

标签: boost visual-studio-2015 boost-variant boost-signals2 cpp-netlib

我无法使用Boost库1.61.0和Visual Studio 2015 Update 3构建我的两个项目。

这些项目过去常常使用Visual Studio和Boost版本的各种组合构建多年,除了更新Visual Studio和Boost库之外,我没有更改代码中的任何内容。

我对这两个项目的错误是:

QSqlDatabase db2 =QSqlDatabase::database();

在这两个项目中,我都没有直接从我的代码中使用boost :: variant。在一种情况下,看起来像boost :: variables2正在使用boost :: signals2(我也不会直接从我的代码中使用),而在另一种情况下,它看起来像是在Cpp中使用了boost :: variant -Netlib 0.11.2。

以下是这两个项目的输出日志的相关部分:

'boost::detail::variant::visitation_impl': none of the 2 overloads could convert all the argument types
1>d:\libraries\boost_1_61_0\boost\variant\detail\visitation_impl.hpp(267): error C2665: 'boost::detail::variant::visitation_impl': none of the 2 overloads could convert all the argument types
1>  d:\libraries\boost_1_61_0\boost\variant\detail\visitation_impl.hpp(201): note: could be 'void boost::detail::variant::visitation_impl<next_which,next_step,Visitor,VoidPtrCV,NoBackupFlag>(const int,const int,Visitor &,VoidPtrCV,boost::mpl::false_,NoBackupFlag,Which *,step0 *)'
1>          with
1>          [
1>              Visitor=boost::detail::variant::destroyer,
1>              VoidPtrCV=void *,
1>              NoBackupFlag=boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::has_fallback_type_,
1>              Which=next_which,
1>              step0=next_step
1>          ]
1>  d:\libraries\boost_1_61_0\boost\variant\detail\visitation_impl.hpp(183): note: or       'void boost::detail::variant::visitation_impl<next_which,next_step,Visitor,VoidPtrCV,NoBackupFlag>(int,int,Visitor &,VPCV,boost::mpl::true_,NBF,W *,S *)'
1>          with
1>          [
1>              Visitor=boost::detail::variant::destroyer,
1>              VoidPtrCV=void *,
1>              NoBackupFlag=boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::has_fallback_type_,
1>              VPCV=void *,
1>              NBF=boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::has_fallback_type_,
1>              W=next_which,
1>              S=next_step
1>          ]
1>  d:\libraries\boost_1_61_0\boost\variant\detail\visitation_impl.hpp(267): note: while trying to match the argument list '(const int, const int, boost::detail::variant::destroyer, void *, is_apply_visitor_unrolled, boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::has_fallback_type_, next_which *, next_step *)'
1>  d:\libraries\boost_1_61_0\boost\variant\variant.hpp(2326): note: see reference to function template instantiation 'void boost::detail::variant::visitation_impl<first_which,first_step,Visitor,VoidPtrCV,boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::has_fallback_type_>(const int,const int,Visitor &,VoidPtrCV,boost::mpl::false_,NoBackupFlag,Which *,step0 *)' being compiled
1>          with
1>          [
1>              Visitor=boost::detail::variant::destroyer,
1>              VoidPtrCV=void *,
1>              NoBackupFlag=boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::has_fallback_type_,
1>              Which=first_which,
1>              step0=first_step
1>          ]
1>  d:\libraries\boost_1_61_0\boost\variant\variant.hpp(2337): note: see reference to function template instantiation 'void boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::internal_apply_visitor_impl<Visitor,void*>(int,int,Visitor &,VoidPtrCV)' being compiled
1>          with
1>          [
1>              Visitor=boost::detail::variant::destroyer,
1>              VoidPtrCV=void *
1>          ]
1>  d:\libraries\boost_1_61_0\boost\variant\variant.hpp(2335): note: see reference to function template instantiation 'void boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::internal_apply_visitor_impl<Visitor,void*>(int,int,Visitor &,VoidPtrCV)' being compiled
1>          with
1>          [
1>              Visitor=boost::detail::variant::destroyer,
1>              VoidPtrCV=void *
1>          ]
1>  d:\libraries\boost_1_61_0\boost\variant\variant.hpp(1345): note: see reference to function template instantiation 'void boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::internal_apply_visitor<boost::detail::variant::destroyer>(Visitor &)' being compiled
1>          with
1>          [
1>              Visitor=boost::detail::variant::destroyer
1>          ]
1>  d:\libraries\boost_1_61_0\boost\variant\variant.hpp(1345): note: see reference to function template instantiation 'void boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::internal_apply_visitor<boost::detail::variant::destroyer>(Visitor &)' being compiled
1>          with
1>          [
1>              Visitor=boost::detail::variant::destroyer
1>          ]
1>  d:\libraries\boost_1_61_0\boost\variant\variant.hpp(1343): note: while compiling class template member function 'void boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::destroy_content(void) noexcept'
1>  d:\libraries\boost_1_61_0\boost\variant\variant.hpp(1352): note: see reference to function template instantiation 'void boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>::destroy_content(void) noexcept' being compiled
1>  d:\libraries\boost_1_61_0\boost\signals2\slot_base.hpp(47): note: see reference to class template instantiation 'boost::variant<boost::shared_ptr<void>,boost::signals2::detail::foreign_void_shared_ptr,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_,boost::detail::variant::void_>' being compiled

这是增强库中的错误吗?

1 个答案:

答案 0 :(得分:2)

听起来你的Boost安装很糟糕。您是否保留了Boost的多个版本?有多个Boost 1.61.0和Visual Studio 2015更新3在Web上成功协作的示例though this one does say there are some issues with the new SFINAE feature

尝试删除旧的Boost安装并彻底安装Boost 1.61.0 from the Boost distribution

Visual Studio在安装或更新过程中也可能已损坏,但我发现这些类型的问题较少。