Tweaks to try to defeat g++4.6.3

This commit is contained in:
Emil Dotchevski
2017-01-03 14:35:11 -08:00
parent 406d3c87f7
commit 972667f52e
3 changed files with 29 additions and 61 deletions

View File

@ -44,37 +44,44 @@ boost
public exception_detail::error_info_base public exception_detail::error_info_base
{ {
public: public:
typedef T value_type; typedef T value_type;
error_info( value_type const & v ):
error_info( value_type const & v ); v_(v)
{
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
error_info( error_info const & ); error_info( error_info const & x ):
error_info( value_type && v ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(v)))); v_(x.v_)
error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.v_)))); {
}
error_info( value_type && v ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(v)))):
v_(std::move(v))
{
}
error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.v_)))):
v_(std::move(x.v_))
{
}
#endif #endif
~error_info() throw(); ~error_info() throw()
{
}
value_type const & value_type const &
value() const value() const
{ {
return v_; return v_;
} }
value_type & value_type &
value() value()
{ {
return v_; return v_;
} }
private: private:
error_info & operator=( error_info const & ); error_info & operator=( error_info const & );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
error_info & operator=( error_info && x ); error_info & operator=( error_info && x );
#endif #endif
std::string name_value_string() const; std::string name_value_string() const;
value_type v_; value_type v_;
}; };
} }

View File

@ -38,45 +38,6 @@ boost
return '[' + error_info_name(x) + "] = " + to_string_stub(x.value()) + '\n'; return '[' + error_info_name(x) + "] = " + to_string_stub(x.value()) + '\n';
} }
template <class Tag,class T>
inline
error_info<Tag,T>::
error_info( value_type const & v ):
v_(v)
{
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class Tag,class T>
inline
error_info<Tag,T>::
error_info( error_info const & x ):
v_(x.v_)
{
}
template <class Tag,class T>
inline
error_info<Tag,T>::
error_info( value_type && v ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(v)))):
v_(std::move(v))
{
}
template <class Tag,class T>
inline
error_info<Tag,T>::
error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.v_)))):
v_(std::move(x.v_))
{
}
#endif
template <class Tag,class T>
inline
error_info<Tag,T>::
~error_info() throw()
{
}
template <class Tag,class T> template <class Tag,class T>
inline inline
std::string std::string

View File

@ -16,14 +16,14 @@ typedef boost::error_info<struct error_info_string_, std::string> error_info_str
int int
main() main()
{ {
try try
{ {
throw my_exception() << error_info_string("doh"); throw my_exception() << error_info_string("doh");
} }
catch( my_exception & e ) catch( my_exception & e )
{ {
BOOST_TEST(boost::get_error_info<error_info_string>(e) && !strcmp(boost::get_error_info<error_info_string>(e)->c_str(),"doh")); BOOST_TEST(boost::get_error_info<error_info_string>(e) && !strcmp(boost::get_error_info<error_info_string>(e)->c_str(),"doh"));
} }
return 0; return 0;
} }