mirror of
https://github.com/boostorg/move.git
synced 2025-07-30 12:27:14 +02:00
Fixes #8420 and some clang errors.
This commit is contained in:
@ -758,8 +758,9 @@ Many thanks to all boosters that have tested, reviewed and improved the library.
|
|||||||
[section:release_notes_boost_1_56_00 Boost 1.56 Release]
|
[section:release_notes_boost_1_56_00 Boost 1.56 Release]
|
||||||
|
|
||||||
* Added [macroref BOOST_MOVE_RET BOOST_MOVE_RET].
|
* Added [macroref BOOST_MOVE_RET BOOST_MOVE_RET].
|
||||||
* Fixed bug [@https://svn.boost.org/trac/boost/ticket/9482 #9482: ['"MSVC macros not undefined in boost/move/detail/config_end.hpp"]].
|
* Fixed bug [@https://svn.boost.org/trac/boost/ticket/9482 #9482: ['"MSVC macros not undefined in boost/move/detail/config_end.hpp"]],
|
||||||
[@https://svn.boost.org/trac/boost/ticket/9045 #9045: ['"Wrong macro name on docs"]].
|
[@https://svn.boost.org/trac/boost/ticket/9045 #9045: ['"Wrong macro name on docs"]],
|
||||||
|
[@https://svn.boost.org/trac/boost/ticket/8420 #8420: ['"move's is_convertible does not compile with aligned data"]].
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
@ -35,7 +35,10 @@ class movable
|
|||||||
{ value_ = m.value_; m.value_ = 0; return *this; }
|
{ value_ = m.value_; m.value_ = 0; return *this; }
|
||||||
|
|
||||||
bool moved() const //Observer
|
bool moved() const //Observer
|
||||||
{ return value_ == 0; }
|
{ return !value_; }
|
||||||
|
|
||||||
|
int value() const //Observer
|
||||||
|
{ return value_; }
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
@ -72,19 +72,32 @@ struct identity
|
|||||||
typedef T type;
|
typedef T type;
|
||||||
};
|
};
|
||||||
|
|
||||||
//is_convertible
|
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||||
|
|
||||||
|
//use intrinsic since in MSVC
|
||||||
|
//overaligned types can't go through ellipsis
|
||||||
|
template <class T, class U>
|
||||||
|
struct is_convertible
|
||||||
|
{
|
||||||
|
static const bool value = __is_convertible_to(T, U);
|
||||||
|
};
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
template <class T, class U>
|
template <class T, class U>
|
||||||
class is_convertible
|
class is_convertible
|
||||||
{
|
{
|
||||||
typedef char true_t;
|
typedef char true_t;
|
||||||
class false_t { char dummy[2]; };
|
class false_t { char dummy[2]; };
|
||||||
static true_t dispatch(U);
|
|
||||||
static false_t dispatch(...);
|
static false_t dispatch(...);
|
||||||
|
static true_t dispatch(U);
|
||||||
static T &trigger();
|
static T &trigger();
|
||||||
public:
|
public:
|
||||||
enum { value = sizeof(dispatch(trigger())) == sizeof(true_t) };
|
static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//and_ not_
|
//and_ not_
|
||||||
template <typename Condition1, typename Condition2, typename Condition3 = integral_constant<bool, true> >
|
template <typename Condition1, typename Condition2, typename Condition3 = integral_constant<bool, true> >
|
||||||
struct and_
|
struct and_
|
||||||
|
@ -40,7 +40,7 @@ int main()
|
|||||||
boost::move_backward(v2.begin(), v2.end(), v.end());
|
boost::move_backward(v2.begin(), v2.end(), v.end());
|
||||||
|
|
||||||
//Test values have been moved
|
//Test values have been moved
|
||||||
if(!v2[0].moved()){
|
if(!v2[1].moved()){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ int main()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(v[0].moved()){
|
if(v[1].moved()){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user