Hello,
my application which was successfully compiled on VS2010 brings the next errors using VS2012 c:\program files (x86)\boost\boost_1_51_0\boost\log\sources\basic_logger.hpp(227): error C2664: 'std::pair<_Ty1,_Ty2> boost::log_mt_nt5::basic_attribute_set<CharT>::insert(const std::pair<const boost::log_mt_nt5::basic_slim_string<CharT>,boost::log_mt_nt5::basic_attribute_set<CharT>::mapped_type> )' : cannot convert parameter 1 from 'std::pair<_Ty1,_Ty2>' to 'const std::pair<_Ty1,_Ty2> &' 4> with 4> [ 4> _Ty1=boost::log_mt_nt5::basic_attribute_set<char>::iter<false>, 4> _Ty2=bool, 4> CharT=char 4> ] 4> and 4> [ 4> _Ty1=std::basic_string<char,std::char_traits<char>,std::allocator<char>>, 4> _Ty2=boost::shared_ptr<boost::log_mt_nt5::attribute> 4> ] 4> and 4> [ 4> _Ty1=const boost::log_mt_nt5::basic_slim_string<char>, 4> _Ty2=boost::log_mt_nt5::basic_attribute_set<char>::mapped_type 4> ] 4> Reason: cannot convert from 'std::pair<_Ty1,_Ty2>' to 'const std::pair<_Ty1,_Ty2>' 4> with 4> [ 4> _Ty1=std::basic_string<char,std::char_traits<char>,std::allocator<char>>, 4> _Ty2=boost::shared_ptr<boost::log_mt_nt5::attribute> 4> ] 4> and 4> [ 4> _Ty1=const boost::log_mt_nt5::basic_slim_string<char>, 4> _Ty2=boost::log_mt_nt5::basic_attribute_set<char>::mapped_type 4> ] 4> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 4> c:\program files (x86)\boost\boost_1_51_0\boost\log\sources\basic_logger.hpp(226) : while compiling class template member function 'std::pair<_Ty1,_Ty2> boost::log_mt_nt5::sources::basic_logger<CharT,FinalT,ThreadingModelT>::add_attribute_unlocked(const std::basic_string<_Elem,_Traits,_Alloc> &,const boost::shared_ptr<T> &)' 4> with 4> [ 4> _Ty1=boost::log_mt_nt5::basic_attribute_set<char>::iter<false>, 4> _Ty2=bool, 4> CharT=char, 4> FinalT=manster::logger::manster_logger_mt, 4> ThreadingModelT=boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>, 4> _Elem=char, 4> _Traits=std::char_traits<char>, 4> _Alloc=std::allocator<char>, 4> T=boost::log_mt_nt5::attribute 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\log\sources\severity_feature.hpp(188) : see reference to function template instantiation 'std::pair<_Ty1,_Ty2> boost::log_mt_nt5::sources::basic_logger<CharT,FinalT,ThreadingModelT>::add_attribute_unlocked(const std::basic_string<_Elem,_Traits,_Alloc> &,const boost::shared_ptr<T> &)' being compiled 4> with 4> [ 4> _Ty1=boost::log_mt_nt5::basic_attribute_set<char>::iter<false>, 4> _Ty2=bool, 4> CharT=char, 4> FinalT=manster::logger::manster_logger_mt, 4> ThreadingModelT=boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>, 4> _Elem=char, 4> _Traits=std::char_traits<char>, 4> _Alloc=std::allocator<char>, 4> T=boost::log_mt_nt5::attribute 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\log\sources\channel_feature.hpp(212) : see reference to class template instantiation 'boost::log_mt_nt5::sources::basic_logger<CharT,FinalT,ThreadingModelT>' being compiled 4> with 4> [ 4> CharT=char, 4> FinalT=manster::logger::manster_logger_mt, 4> ThreadingModelT=boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex> 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\log\sources\basic_logger.hpp(315) : see reference to class template instantiation 'boost::log_mt_nt5::sources::channel<ChannelT>::apply<BaseT>' being compiled 4> with 4> [ 4> ChannelT=std::string, 4> BaseT=boost::log_mt_nt5::sources::basic_logger<char,manster::logger::manster_logger_mt,boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>> 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\mpl\aux_\preprocessed\plain\apply_wrap.hpp(49) : see reference to class template instantiation 'boost::log_mt_nt5::sources::aux::inherit_logger_features::apply<PrevT,T>' being compiled 4> with 4> [ 4> PrevT=boost::log_mt_nt5::sources::basic_logger<char,manster::logger::manster_logger_mt,boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>>, 4> T=boost::log_mt_nt5::sources::channel<std::string> 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\mpl\aux_\preprocessed\plain\apply.hpp(63) : see reference to class template instantiation 'boost::mpl::apply_wrap2<F,T1,T2>' being compiled 4> with 4> [ 4> F=boost::log_mt_nt5::sources::aux::inherit_logger_features, 4> T1=boost::log_mt_nt5::sources::basic_logger<char,manster::logger::manster_logger_mt,boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>>, 4> T2=boost::log_mt_nt5::sources::channel<std::string> 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\mpl\aux_\preprocessed\plain\reverse_fold_impl.hpp(81) : see reference to class template instantiation 'boost::mpl::apply2<F,T1,T2>' being compiled 4> with 4> [ 4> F=boost::log_mt_nt5::sources::aux::inherit_logger_features, 4> T1=boost::log_mt_nt5::sources::basic_logger<char,manster::logger::manster_logger_mt,boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>>, 4> T2=boost::log_mt_nt5::sources::channel<std::string> 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\mpl\reverse_fold.hpp(41) : see reference to class template instantiation 'boost::mpl::aux::reverse_fold_impl<N,First,Last,State,BackwardOp,ForwardOp>' being compiled 4> with 4> [ 4> N=2, 4> First=boost::mpl::v_iter<boost::mpl::vector2<boost::log_mt_nt5::sources::severity<severity_level>,boost::log_mt_nt5::sources::channel<std::string>>,0>, 4> Last=boost::mpl::v_iter<boost::mpl::vector2<boost::log_mt_nt5::sources::severity<severity_level>,boost::log_mt_nt5::sources::channel<std::string>>,2>, 4> State=boost::log_mt_nt5::sources::basic_logger<char,manster::logger::manster_logger_mt,boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>>, 4> BackwardOp=boost::log_mt_nt5::sources::aux::inherit_logger_features, 4> ForwardOp=boost::mpl::arg<1> 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\log\sources\basic_logger.hpp(338) : see reference to class template instantiation 'boost::mpl::reverse_fold<Sequence,State,BackwardOp>' being compiled 4> with 4> [ 4> Sequence=boost::log_mt_nt5::sources::features<boost::log_mt_nt5::sources::severity<severity_level>,boost::log_mt_nt5::sources::channel<std::string>>, 4> State=boost::log_mt_nt5::sources::basic_logger<char,manster::logger::manster_logger_mt,boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>>, 4> BackwardOp=boost::log_mt_nt5::sources::aux::inherit_logger_features 4> ] 4> d:\sankom\manster\manster\manster\manster_logger.h(160) : see reference to class template instantiation 'boost::log_mt_nt5::sources::basic_composite_logger<CharT,FinalT,ThreadingModelT,FeaturesT>' being compiled 4> with 4> [ 4> CharT=char, 4> FinalT=manster::logger::manster_logger_mt, 4> ThreadingModelT=boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>, 4> FeaturesT=boost::log_mt_nt5::sources::features<boost::log_mt_nt5::sources::severity<severity_level>,boost::log_mt_nt5::sources::channel<std::string>> 4> ] What is the solution ? |
[syvyi]
> my application which was successfully compiled on VS2010 brings the next > errors using VS2012 Unlike VS 2010, VS 2012's std::pair follows C++11's requirements precisely. In particular, A must be implicitly convertible to X and B must be implicitly convertible to Y in order for pair<A, B> to be implicitly convertible to pair<X, Y>. It appears that you have types that are explicitly convertible, but not implicitly convertible. You should probably provide a self-contained test case, so a Boost developer can figure out whether this is a bug in your code or in Boost. Stephan T. Lavavej Visual C++ Libraries Developer _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost |
In reply to this post by syvyi
On January 9, 2013 2:53:36 AM syvyi <[hidden email]> wrote:
> Hello, > > my application which was successfully compiled on VS2010 brings the next > errors using VS2012 > > c:\program files > (x86)\boost\boost_1_51_0\boost\log\sources\basic_logger.hpp(227): error > C2664: 'std::pair<_Ty1,_Ty2> > boost::log_mt_nt5::basic_attribute_set<CharT>::insert(const std::pair<const > boost::log_mt_nt5::basic_slim_string<CharT>,boost::log_mt_nt5::basic_attribute_set<CharT>::mapped_type> > )' : cannot convert parameter 1 from 'std::pair<_Ty1,_Ty2>' to 'const > std::pair<_Ty1,_Ty2> &' > > What is the solution ? I think I've seen this problem before. Did you try the version from SVN, branches/v1? _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost |
I didn't find v1 in branches. link
|
On Wed, Jan 9, 2013 at 3:28 PM, syvyi <[hidden email]> wrote:
> I didn't find v1 in branches. link > <http://svn.boost.org/svn/boost/branches/> The library is currently hosted on SourceForge: http://sourceforge.net/projects/boost-log/ To checkout the latest v1 you have to execute: svn co https://boost-log.svn.sourceforge.net/svnroot/boost-log/branches/v1 boost-log-v1 _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost |
That's partial result after compilation with Boost.Log under v1.
c:\program files (x86)\boost\boost_1_51_0\boost\log\sources\global_logger_storage.hpp(136): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 4> d:\visual studio 11.0\vc\include\stdio.h(357) : see declaration of 'sprintf' 4> c:\program files (x86)\boost\boost_1_51_0\boost\log\sources\global_logger_storage.hpp(122) : while compiling class template member function 'void boost::log_mt_nt5::sources::aux::logger_singleton<TagT>::init_instance(void)' 4> with 4> [ 4> TagT=boost::log_mt_nt5::trivial::logger 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\log\detail\singleton.hpp(43) : see reference to function template instantiation 'void boost::log_mt_nt5::sources::aux::logger_singleton<TagT>::init_instance(void)' being compiled 4> with 4> [ 4> TagT=boost::log_mt_nt5::trivial::logger 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\log\trivial.hpp(100) : see reference to class template instantiation 'boost::log_mt_nt5::sources::aux::logger_singleton<TagT>' being compiled 4> with 4> [ 4> TagT=boost::log_mt_nt5::trivial::logger 4> ] 4> manster_logger.cpp 4>c:\program files (x86)\boost\boost_1_51_0\boost\log\sources\channel_feature.hpp(190): error C2248: 'boost::log_mt_nt5::sources::basic_logger<CharT,FinalT,ThreadingModelT>::operator =' : cannot access private member declared in class 'boost::log_mt_nt5::sources::basic_logger<CharT,FinalT,ThreadingModelT>' 4> with 4> [ 4> CharT=char, 4> FinalT=manster::logger::manster_logger_mt, 4> ThreadingModelT=boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex> 4> ] 4> c:\program files (x86)\boost\boost_1_51_0\boost\log\sources\basic_logger.hpp(291) : see declaration of 'boost::log_mt_nt5::sources::basic_logger<CharT,FinalT,ThreadingModelT>::operator =' 4> with 4> [ 4> CharT=char, 4> FinalT=manster::logger::manster_logger_mt, 4> ThreadingModelT=boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex> 4> ] 4> This diagnostic occurred in the compiler generated function 'boost::log_mt_nt5::sources::basic_channel_logger<BaseT,ChannelT> &boost::log_mt_nt5::sources::basic_channel_logger<BaseT,ChannelT>::operator =(const boost::log_mt_nt5::sources::basic_channel_logger<BaseT,ChannelT> &)' 4> with 4> [ 4> BaseT=boost::log_mt_nt5::sources::basic_logger<char,manster::logger::manster_logger_mt,boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>>, 4> ChannelT=std::basic_string<char,std::char_traits<char>,std::allocator<char>> 4> ] |
On Wed, Jan 9, 2013 at 4:18 PM, syvyi <[hidden email]> wrote:
> That's partial result after compilation with Boost.Log under v1. > > c:\program files > (x86)\boost\boost_1_51_0\boost\log\sources\global_logger_storage.hpp(136): > warning C4996: 'sprintf': This function or variable may be unsafe. Consider > using sprintf_s instead. To disable deprecation, use > _CRT_SECURE_NO_WARNINGS. See online help for details. > 4> d:\visual studio 11.0\vc\include\stdio.h(357) : see declaration > of 'sprintf' This annoying warning can be silenced by defining the macro mentioned in the message. > 4>c:\program files > (x86)\boost\boost_1_51_0\boost\log\sources\channel_feature.hpp(190): error > C2248: > 'boost::log_mt_nt5::sources::basic_logger<CharT,FinalT,ThreadingModelT>::operator > =' : cannot access private member declared in class > 'boost::log_mt_nt5::sources::basic_logger<CharT,FinalT,ThreadingModelT>' [snip] > 4> This diagnostic occurred in the compiler generated function > 'boost::log_mt_nt5::sources::basic_channel_logger<BaseT,ChannelT> > &boost::log_mt_nt5::sources::basic_channel_logger<BaseT,ChannelT>::operator > =(const boost::log_mt_nt5::sources::basic_channel_logger<BaseT,ChannelT> &)' > 4> with > 4> [ > 4> > BaseT=boost::log_mt_nt5::sources::basic_logger<char,manster::logger::manster_logger_mt,boost::log_mt_nt5::sources::multi_thread_model<boost::log_mt_nt5::aux::light_rw_mutex>>, > 4> > ChannelT=std::basic_string<char,std::char_traits<char>,std::allocator<char>> > 4> ] basic_logger::operator= should never be called, it is not used by the derived classes. It is not clear to me why the compiler generated its own operator= while there is one already in basic_composite_logger. Could you post a minimal code sample that triggers this error? _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost |
Free forum by Nabble | Edit this page |