对这个简单的官方提升::iostream代码发出了一系列警告
A bunch of warning was given to this simple official boost::iostream code?
我正在字符串中使用boost编写文本文件,官方文档中一个真正简短的例子是:
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/stream.hpp>
typedef stream<file_sink> ofstream;
ofstream out("HeavyArtillery.txt"); // Wilfred Owen
out << "Reach at that Arrogance which needs thy harm,n"
"And beat it down before its sins grow worse.n";
out.close();
我做了几乎相同的事情:
#include <boost/filesystem/path.hpp>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/stream.hpp>
typedef boost::iostreams::stream <boost::iostreams::file_sink> BoostIOStream;
BoostIOStream DebugFileOutputStream("IntermediaArrays.txt");
但上面的代码给出了很多类似下面的警告。我使用的是cuda,所以源文件名为main.cu,但编译器是nmake。有人能告诉我怎么了吗?
1> Building NVCC (Device) object CMakeFiles/SrmLevelSet.dir/src/Debug/SrmLevelSet_generated_main.cu.obj
1> main.cu
1>
1>D:devlibboost_1_58_0boost/iostreams/detail/streambuf/indirect_streambuf.hpp(50): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode>::~indirect_streambuf [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "std::basic_streambuf<_Elem, _Traits>::~basic_streambuf [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream_buffer.hpp(65): here
1>
1> instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/utility/base_from_member.hpp(127): here
1>
1> instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(75): here
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/detail/streambuf/indirect_streambuf.hpp(50): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode>::~indirect_streambuf [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "boost::iostreams::detail::linked_streambuf<Ch, Tr>::~linked_streambuf [with Ch=char, Tr=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream_buffer.hpp(65): here
1>
1> instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/utility/base_from_member.hpp(127): here
1>
1> instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(75): here
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream_buffer.hpp(87): warning : exception specification for virtual function "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode>::~stream_buffer [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "std::basic_streambuf<_Elem, _Traits>::~basic_streambuf [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/utility/base_from_member.hpp(127): here
1>
1> instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(75): here
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream_buffer.hpp(87): warning : exception specification for virtual function "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode>::~stream_buffer [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "boost::iostreams::detail::linked_streambuf<Ch, Tr>::~linked_streambuf [with Ch=char, Tr=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/utility/base_from_member.hpp(127): here
1>
1> instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(75): here
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::ios_base::~ios_base"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> (112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::basic_ios<_Elem, _Traits>::~basic_ios [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> (112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::basic_ostream<_Elem, _Traits>::~basic_ostream [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> (112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::ios_base::~ios_base"
1>
1> detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::basic_ios<_Elem, _Traits>::~basic_ios [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::basic_ostream<_Elem, _Traits>::~basic_ostream [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/array.hpp(123): warning : controlling expression is constant
1>
1>
1>
1>D:devlibboost_1_58_0boost/array.hpp(129): warning : controlling expression is constant
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/detail/streambuf/indirect_streambuf.hpp(50): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode>::~indirect_streambuf [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "std::basic_streambuf<_Elem, _Traits>::~basic_streambuf [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream_buffer.hpp(65): here
1>
1> instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/utility/base_from_member.hpp(127): here
1>
1> instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(75): here
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/detail/streambuf/indirect_streambuf.hpp(50): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode>::~indirect_streambuf [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "boost::iostreams::detail::linked_streambuf<Ch, Tr>::~linked_streambuf [with Ch=char, Tr=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::detail::indirect_streambuf<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream_buffer.hpp(65): here
1>
1> instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/utility/base_from_member.hpp(127): here
1>
1> instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(75): here
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream_buffer.hpp(87): warning : exception specification for virtual function "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode>::~stream_buffer [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "std::basic_streambuf<_Elem, _Traits>::~basic_streambuf [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/utility/base_from_member.hpp(127): here
1>
1> instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(75): here
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream_buffer.hpp(87): warning : exception specification for virtual function "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode>::~stream_buffer [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]" is incompatible with that of overridden function "boost::iostreams::detail::linked_streambuf<Ch, Tr>::~linked_streambuf [with Ch=char, Tr=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::stream_buffer<T, Tr, Alloc, Mode> [with T=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Mode=boost::iostreams::output_seekable]"
1>
1> D:devlibboost_1_58_0boost/utility/base_from_member.hpp(127): here
1>
1> instantiation of class "boost::base_from_member<MemberType, UniqueID> [with MemberType=boost::iostreams::stream_buffer<boost::iostreams::file_sink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output_seekable>, UniqueID=0]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(75): here
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::ios_base::~ios_base"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> (112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::basic_ios<_Elem, _Traits>::~basic_ios [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> (112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(74): warning : exception specification for implicitly declared virtual function "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base>::~stream_base [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]" is incompatible with that of overridden function "std::basic_ostream<_Elem, _Traits>::~basic_ostream [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during:
1>
1> instantiation of class "boost::iostreams::detail::stream_base<Device, Tr, Alloc, Base> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>, Base=std::basic_ostream<char, std::char_traits<char>>]"
1>
1> (112): here
1>
1> instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::ios_base::~ios_base"
1>
1> detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::basic_ios<_Elem, _Traits>::~basic_ios [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1>D:devlibboost_1_58_0boost/iostreams/stream.hpp(112): warning : exception specification for implicitly declared virtual function "boost::iostreams::stream<Device, Tr, Alloc>::~stream [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]" is incompatible with that of overridden function "std::basic_ostream<_Elem, _Traits>::~basic_ostream [with _Elem=char, _Traits=std::char_traits<char>]"
1>
1> detected during instantiation of class "boost::iostreams::stream<Device, Tr, Alloc> [with Device=boost::iostreams::file_sink, Tr=std::char_traits<char>, Alloc=std::allocator<char>]"
1>
1> D:/SrmLevelSet/src/main.cu(46): here
1>
1>
1>
1> main.cu
1>
尽管Boost对NVCC有基本支持(请参阅票据#3919),但它不是用于测试发行版的主要或附加测试编译器之一。有关主要和附加测试编译器的列表,请参阅您正在使用的Boost版本的发行说明。
从您发布的警告来看,NVCC似乎没有正确设置隐式声明的析构函数的异常规范。请参阅C++规范的[除.spec]部分。特别是,如果隐式声明的析构函数f
调用的任何函数都允许所有异常,那么它的异常规范应该允许所有异常;如果它调用的所有函数都不允许异常,那么应该不允许任何异常。例如,关于第一个警告,隐式声明的boost::iostreams::detail::indirect_streambuf
析构函数应该允许所有异常,因为显式声明的虚拟std::basic_streambuf
析构函数允许所有异常(请参见C++规范的[lib.streambuf]部分)。如果非要我猜测的话,看起来NVCC将隐式声明的析构函数的异常规范默认为throw()
(C++11中的noexcept
)。
有两个警告与不兼容的异常规范无关:
1>D: \dev\lib\boost_1_58_0\boost/array.hpp(123):警告:控制表达式是常量1>1>1>1>D: \dev\lib\boost_1_58_0\boost/array.hpp(129):警告:控制表达式是常量
这可能是由于BOOstrongSERT_MSG回退到使用标准C assert()
宏:
# define BOOST_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
&&(msg)
部分只是一个技巧,它允许消息被包括在被断言的表达式的字符串化中。当msg
是字符串文字(常量)时,作为布尔表达式的(msg)
将为true。
相关文章:
- C++我的数学有什么问题,为什么我的代码不能正确循环
- 代码在main()中运行,但在函数中出现错误
- 在VS代码中交叉编译Windows与Linux上的MinGW的SDL程序
- 编译包含字符串的代码时遇到问题
- 我在c++代码中生成了一个运行时#3异常
- 如何在linux终端中同时编译和运行c++代码
- 为cl.exe(Visual Studio代码)指定命令行C++版本
- 如果 iostream 对象不可复制,为什么以下代码是合法的?
- 磁力计代码:C++ vs C - iosstream,矢量 - 错误iostream:没有这样的文件或目录
- 在代码::块中找不到iostream文件
- 通过包含<iostream>头文件,它的所有 8 个函数是写入我的代码,还是只写入我在程序中使用的函数?
- 数字火星编译器(代码::块)无法打开文件'iostream'
- 为什么包含iostream时此代码更快?
- 添加<iostream>会中断 G++-7 中的代码
- dev 代码::Blocks/ Dev-c++: 错误: iostream: 没有这样的文件或目录
- 对这个简单的官方提升::iostream代码发出了一系列警告
- 将iostream输入代码从c++移植到c#
- Iostream库不包含在代码块中
- 代码::阻塞iostream.h文件丢失
- 为什么我的代码需要<iostream>?