无法编译启用 BullseyeCoverage 和 Casablanca REST SDK 的 Visual Studio 2013 C++ 项目
Cannot compile Visual Studio 2013 C++ project with enabled BullseyeCoverage and Casablanca REST SDK
我有 Visual Studio 2013 C++ 项目,它利用了 Casablanca REST SDK 功能。项目编译正常。我启用了 BullseyeCoverage Compile C++ 8.9.50 Windows License XXXX 并且项目中出现错误:
1> D:rdparty\casablanca-2.4.0-r2\release\include\cpprest\astreambuf.h(404): error C2440: '?' : cannot convert from 'Concurrency::task<void>' to 'bool'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1> D:rdparty\casablanca-2.4.0-r2\release\include\cpprest\astreambuf.h(391) : while compiling class template member function 'Concurrency::task<void> Concurrency::streams::details::streambuf_state_manager<char>::close(std::ios_base::openmode)'
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\containerstream.h(54) : see reference to class template instantiation 'Concurrency::streams::details::streambuf_state_manager<char>' being compiled
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\containerstream.h(535) : see reference to class template instantiation 'Concurrency::streams::details::basic_container_buffer<_CollectionType>' being compiled
1> with
1> [
1> _CollectionType=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
1> ]
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\containerstream.h(533) : while compiling class template member function 'Concurrency::streams::container_buffer<_CollectionType>::container_buffer(_CollectionType,std::ios_base::openmode)'
1> with
1> [
1> _CollectionType=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
1> ]
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\containerstream.h(616) : see reference to function template instantiation 'Concurrency::streams::container_buffer<_CollectionType>::container_buffer(_CollectionType,std::ios_base::openmode)' being compiled
1> with
1> [
1> _CollectionType=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
1> ]
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\containerstream.h(616) : see reference to class template instantiation 'Concurrency::streams::container_buffer<_CollectionType>' being compiled
1> with
1> [
1> _CollectionType=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
1> ]
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\http_msg.h(491) : see reference to function template instantiation 'Concurrency::streams::istream Concurrency::streams::bytestream::open_istream<std::string>(_CollectionType)' being compiled
1> with
1> [
1> _CollectionType=std::string
1> ]
1>CL : error : status 2 from c:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/CL.exe
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
当我禁用靶心覆盖时,一切都可以正常构建。有什么解决方法的建议吗?
将astreambuf.h中的line:427改成如下
//closeOp = closeOp && _close_write().then([this_ptr]{});
// passing down exceptions from closeOp
closeOp = operator&&(closeOp, _close_write().then([this_ptr]{}));
需要显式调用运算符 &&,因为逻辑被覆盖,靶心不知道如何处理它。
我有 Visual Studio 2013 C++ 项目,它利用了 Casablanca REST SDK 功能。项目编译正常。我启用了 BullseyeCoverage Compile C++ 8.9.50 Windows License XXXX 并且项目中出现错误:
1> D:rdparty\casablanca-2.4.0-r2\release\include\cpprest\astreambuf.h(404): error C2440: '?' : cannot convert from 'Concurrency::task<void>' to 'bool'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1> D:rdparty\casablanca-2.4.0-r2\release\include\cpprest\astreambuf.h(391) : while compiling class template member function 'Concurrency::task<void> Concurrency::streams::details::streambuf_state_manager<char>::close(std::ios_base::openmode)'
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\containerstream.h(54) : see reference to class template instantiation 'Concurrency::streams::details::streambuf_state_manager<char>' being compiled
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\containerstream.h(535) : see reference to class template instantiation 'Concurrency::streams::details::basic_container_buffer<_CollectionType>' being compiled
1> with
1> [
1> _CollectionType=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
1> ]
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\containerstream.h(533) : while compiling class template member function 'Concurrency::streams::container_buffer<_CollectionType>::container_buffer(_CollectionType,std::ios_base::openmode)'
1> with
1> [
1> _CollectionType=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
1> ]
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\containerstream.h(616) : see reference to function template instantiation 'Concurrency::streams::container_buffer<_CollectionType>::container_buffer(_CollectionType,std::ios_base::openmode)' being compiled
1> with
1> [
1> _CollectionType=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
1> ]
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\containerstream.h(616) : see reference to class template instantiation 'Concurrency::streams::container_buffer<_CollectionType>' being compiled
1> with
1> [
1> _CollectionType=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
1> ]
1> d:rdparty\casablanca-2.4.0-r2\release\include\cpprest\http_msg.h(491) : see reference to function template instantiation 'Concurrency::streams::istream Concurrency::streams::bytestream::open_istream<std::string>(_CollectionType)' being compiled
1> with
1> [
1> _CollectionType=std::string
1> ]
1>CL : error : status 2 from c:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/CL.exe
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
当我禁用靶心覆盖时,一切都可以正常构建。有什么解决方法的建议吗?
将astreambuf.h中的line:427改成如下
//closeOp = closeOp && _close_write().then([this_ptr]{});
// passing down exceptions from closeOp
closeOp = operator&&(closeOp, _close_write().then([this_ptr]{}));
需要显式调用运算符 &&,因为逻辑被覆盖,靶心不知道如何处理它。