Fixes #8420 and some clang errors.

This commit is contained in:
Ion Gaztañaga
2014-02-24 08:29:31 +01:00
parent f1de12bfef
commit 51c9e874a8
4 changed files with 25 additions and 8 deletions
+16 -3
View File
@@ -72,19 +72,32 @@ struct identity
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>
class is_convertible
{
typedef char true_t;
class false_t { char dummy[2]; };
static true_t dispatch(U);
static false_t dispatch(...);
static true_t dispatch(U);
static T &trigger();
public:
enum { value = sizeof(dispatch(trigger())) == sizeof(true_t) };
static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t);
};
#endif
//and_ not_
template <typename Condition1, typename Condition2, typename Condition3 = integral_constant<bool, true> >
struct and_