forked from boostorg/exception
Merge branch 'develop' of https://github.com/boostorg/exception into develop
This commit is contained in:
25
.travis.yml
25
.travis.yml
@ -25,6 +25,8 @@ env:
|
|||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
|
- g++-4.7
|
||||||
|
- g++-4.8
|
||||||
- g++-4.9
|
- g++-4.9
|
||||||
- g++-5
|
- g++-5
|
||||||
- g++-6
|
- g++-6
|
||||||
@ -45,31 +47,34 @@ matrix:
|
|||||||
|
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
env: TOOLSET=gcc COMPILER=g++
|
env: TOOLSET=gcc COMPILER=g++ CXXSTD=c++0x
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: TOOLSET=gcc COMPILER=g++-4.9
|
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++0x
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: TOOLSET=gcc COMPILER=g++-5
|
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++0x
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: TOOLSET=gcc COMPILER=g++-6
|
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++0x
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: TOOLSET=gcc COMPILER=g++-6
|
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++0x
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.6
|
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++0x
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.7
|
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++0x
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: TOOLSET=clang COMPILER=clang++-3.8
|
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++0x
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++0x
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
env: TOOLSET=clang COMPILER=clang++
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++0x
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- cd ..
|
- cd ..
|
||||||
@ -86,7 +91,7 @@ install:
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
- |-
|
- |-
|
||||||
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
|
||||||
- ./b2 libs/exception/test toolset=$TOOLSET
|
- ./b2 libs/exception/test toolset=$TOOLSET
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
|
@ -45,38 +45,47 @@ 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 & value );
|
v_(v)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#if (__GNUC__*100+__GNUC_MINOR__!=406) //workaround for g++ bug
|
||||||
#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 && value ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(value))));
|
v_(x.v_)
|
||||||
error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.value_))));
|
{
|
||||||
|
}
|
||||||
|
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();
|
#endif
|
||||||
|
~error_info() throw()
|
||||||
|
{
|
||||||
|
}
|
||||||
value_type const &
|
value_type const &
|
||||||
value() const
|
value() const
|
||||||
{
|
{
|
||||||
return value_;
|
return v_;
|
||||||
}
|
}
|
||||||
|
|
||||||
value_type &
|
value_type &
|
||||||
value()
|
value()
|
||||||
{
|
{
|
||||||
return value_;
|
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 value_;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,45 +40,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 & value ):
|
|
||||||
value_(value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
|
||||||
template <class Tag,class T>
|
|
||||||
inline
|
|
||||||
error_info<Tag,T>::
|
|
||||||
error_info( error_info const & x ):
|
|
||||||
value_(x.value_)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
template <class Tag,class T>
|
|
||||||
inline
|
|
||||||
error_info<Tag,T>::
|
|
||||||
error_info( value_type && value ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(value)))):
|
|
||||||
value_(std::move(value))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
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.value_)))):
|
|
||||||
value_(std::move(x.value_))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#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
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user