1>F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocSerialization.h(86,5): error C2672: “PackageParamsImpl”: 未找到匹配的重载函数
1>(编译源文件“../../../src/others/interprocess/Interface/MediaWindowControllerInterface.cpp”)
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocSerialization.h(78,6):
1> 可能是“void InterprocSerialization::PackageParamsImpl(boost::archive::binary_oarchive &,const Tuple &,std::integer_sequence<size_t,_Kx...>)”
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocSerialization.h(86,5):
1> “void InterprocSerialization::PackageParamsImpl(boost::archive::binary_oarchive &,const Tuple &,std::integer_sequence<size_t,_Kx...>)”: 无法从“boost::fusion::detail::make_index_sequence<1>”推导出“std::integer_sequence<size_t,_Kx...>”的 模板 参数
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocSerialization.h(86,5):
1> 模板实例化上下文(最早的实例化上下文)为
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interface\MediaWindowControllerInterface.cpp(52,29):
1> 查看对正在编译的函数 模板 实例化“void InterprocSerialization::PackageParams<int>(boost::archive::binary_oarchive &,const std::tuple<int> &)”的引用
1>IPCAPPDownloader.cpp
1>IPCAppEnterpriseListContext.cpp
1>F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewViewScaleWidget.h(20,9): warning C4005: “SCALE_IMAGE_PICTUR_MIN_HEIGHT”: 宏重定义
1>(编译源文件“../../../src/others/interprocess/Interproc/TPFunctionBindUtils.cpp”)
1> F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewScaleImageWidget.h(20,9):
1> 参见“SCALE_IMAGE_PICTUR_MIN_HEIGHT”的前一个定义
1>F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewViewScaleWidget.h(21,9): warning C4005: “SCALE_IMAGE_PICTUR_MIN_WIDTH”: 宏重定义
1>(编译源文件“../../../src/others/interprocess/Interproc/TPFunctionBindUtils.cpp”)
1> F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewScaleImageWidget.h(21,9):
1> 参见“SCALE_IMAGE_PICTUR_MIN_WIDTH”的前一个定义
1>F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewViewScaleWidget.h(20,9): warning C4005: “SCALE_IMAGE_PICTUR_MIN_HEIGHT”: 宏重定义
1>(编译源文件“../../../src/others/interprocess/Interproc/TPWindowControllerEntry.cpp”)
1> F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewScaleImageWidget.h(20,9):
1> 参见“SCALE_IMAGE_PICTUR_MIN_HEIGHT”的前一个定义
1>F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewViewScaleWidget.h(21,9): warning C4005: “SCALE_IMAGE_PICTUR_MIN_WIDTH”: 宏重定义
1>(编译源文件“../../../src/others/interprocess/Interproc/TPWindowControllerEntry.cpp”)
1> F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewScaleImageWidget.h(21,9):
1> 参见“SCALE_IMAGE_PICTUR_MIN_WIDTH”的前一个定义
1>IPCAppExcutorBasicCloud.cpp
1>F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewViewScaleWidget.h(20,9): warning C4005: “SCALE_IMAGE_PICTUR_MIN_HEIGHT”: 宏重定义
1>(编译源文件“../../../src/context/IPCAppContext.cpp”)
1> F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewScaleImageWidget.h(20,9):
1> 参见“SCALE_IMAGE_PICTUR_MIN_HEIGHT”的前一个定义
1>F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewViewScaleWidget.h(21,9): warning C4005: “SCALE_IMAGE_PICTUR_MIN_WIDTH”: 宏重定义
1>(编译源文件“../../../src/context/IPCAppContext.cpp”)
1> F:\updateVPC\vpc2_newest\vms\vms-public\vms-client\SurveillanceSystem\SurveillanceSystem\widget\preview\PreviewScaleImageWidget.h(21,9):
1> 参见“SCALE_IMAGE_PICTUR_MIN_WIDTH”的前一个定义
1>F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocSerialization.h(57,61): error C2672: “GetTuple”: 未找到匹配的重载函数
1>(编译源文件“../../../src/others/interprocess/Interproc/TPFunctionBindUtils.cpp”)
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocSerialization.h(28,7):
1> 可能是“Tuple InterprocSerialization::GetTuple(boost::archive::binary_iarchive *,std::integer_sequence<size_t,_Kx...>)”
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocSerialization.h(57,61):
1> “Tuple InterprocSerialization::GetTuple(boost::archive::binary_iarchive *,std::integer_sequence<size_t,_Kx...>)”: 无法从“boost::fusion::detail::make_index_sequence<1>”推导出“std::integer_sequence<size_t,_Kx...>”的 模板 参数
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocSerialization.h(57,61):
1> 模板实例化上下文(最早的实例化上下文)为
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\TPFunctionBindUtils.cpp(55,23):
1> 查看对正在编译的函数 模板 实例化“InterprocError InterprocMsgManager::Subscribe<void(int)>(const std::string,R (__cdecl *),const std::string)”的引用
1> with
1> [
1> R=void (int)
1> ]
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocMsgManager.h(22,16):
1> 查看对正在编译的函数 模板 实例化“long InterprocListener::RegisterCallback<R>(std::string,R (__cdecl *))”的引用
1> with
1> [
1> R=void (int)
1> ]
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocListener.h(26,27):
1> 查看对正在编译的函数 模板 实例化“void InterprocSerialization::Bind<R>(std::map<std::string,std::function<void (boost::archive::binary_oarchive *,boost::archive::binary_iarchive *)>,std::less<std::string>,std::allocator<std::pair<const std::string,std::function<void (boost::archive::binary_oarchive *,boost::archive::binary_iarchive *)>>>> &,std::string,R (__cdecl *))”的引用
1> with
1> [
1> R=void (int)
1> ]
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocSerialization.h(73,34):
1> 查看对正在编译的函数 模板 实例化“void InterprocSerialization::CallProxy<R>(R (__cdecl *),boost::archive::binary_oarchive *,boost::archive::binary_iarchive *)”的引用
1> with
1> [
1> R=void (int)
1> ]
1> F:\updateVPC\vpc2_newest\vms\vms-public\src\others\interprocess\Interproc\InterprocSerialization.h(65,5):
1> 查看对正在编译的函数 模板 实例化“void InterprocSerialization::CallProxy_<void,int>(R (__cdecl *)(int),boost::archive::binary_oarchive *,boost::archive::binary_iarchive *)”的引用
1> with
1> [
1> R=void
1> ]
这是我的源码:
#pragma once
#include <map>
#include <string>
#include <functional>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/fusion/support/detail/index_sequence.hpp>
#include <tuple>
#include <boost/serialization/vector.hpp>
namespace InterprocSerialization {
template<typename T>
struct type_transfer { typedef T type; };
template<>
struct type_transfer<void> { typedef int type; };
template< typename ... T >
using index_sequence_for = boost::fusion::detail::make_index_sequence< sizeof ... (T) >;
template<typename... Params>
std::tuple<typename std::decay<Params>::type...> MakeTuple(Params... ps)
{
return std::make_tuple(ps...);
}
template<typename Tuple, std::size_t... I>
Tuple GetTuple(boost::archive::binary_iarchive* ia, boost::fusion::detail::index_sequence<I...>) {
Tuple t;
std::initializer_list<int>{ ((*ia >> std::get<I>(t)), 0)... };
return t;
}
template<typename R, typename... Params, typename Tuple, std::size_t... Index >
typename R invoke(R(*f)(Params...), Tuple&& t, boost::fusion::detail::index_sequence<Index...>) {
return f(std::get<Index>(std::forward<Tuple>(t))...);
}
template<typename R, typename F, typename ArgsTuple>
typename std::enable_if<std::is_same<R, void>::value, typename type_transfer<R>::type>::type
CallHelper(F f, ArgsTuple args) {
invoke(f, args, boost::fusion::detail::make_index_sequence<std::tuple_size<typename std::decay<ArgsTuple>::type>::value>{});
return 0;
}
template<typename R, typename F, typename ArgsTuple>
typename std::enable_if<!std::is_same<R, void>::value, typename type_transfer<R>::type>::type
CallHelper(F f, ArgsTuple args) {
return invoke(f, args, boost::fusion::detail::make_index_sequence<std::tuple_size<typename std::decay<ArgsTuple>::type>::value>{});
}
template<typename R, typename... Params>
void CallProxy_(R(*f)(Params... ps),
boost::archive::binary_oarchive* oa,
boost::archive::binary_iarchive* ia) {
std::tuple<typename std::decay<Params>::type...> args = GetTuple<std::tuple<typename std::decay<Params>::type...> >(ia, boost::fusion::detail::make_index_sequence<sizeof...(Params)>());
typename type_transfer<R>::type ret = CallHelper<R>(f, args);
}
template<typename R>
void CallProxy(R(*f), boost::archive::binary_oarchive* oa,
boost::archive::binary_iarchive* ia) {
CallProxy_(f, oa, ia);
}
template<typename R>
void Bind(std::map<std::string,
std::function<void(boost::archive::binary_oarchive*, boost::archive::binary_iarchive*)> > &handlers,
std::string fname, R(*f)) {
// todo ������
handlers[fname] = std::bind(&CallProxy<R>, f, std::placeholders::_1,
std::placeholders::_2);
}
template<typename Tuple, std::size_t... Is>
void PackageParamsImpl(boost::archive::binary_oarchive& oa, const Tuple& t, boost::fusion::detail::index_sequence<Is...>)
{
std::initializer_list<int>{ ((oa << std::get<Is>(t)), 0)... };
}
template<typename... Args>
void PackageParams(boost::archive::binary_oarchive& oa, const std::tuple<Args...>& t)
{
PackageParamsImpl(oa, t, index_sequence_for<Args...>{});
}
} // namespace InterProSerialization
为什么会报错???