| Index: base/template_util.h
|
| diff --git a/base/template_util.h b/base/template_util.h
|
| index 83fa322a67226d512b6a6b3974b76637ee2ffbc7..27e540a9c51b38cc72268c8abcc54a84f78064a9 100644
|
| --- a/base/template_util.h
|
| +++ b/base/template_util.h
|
| @@ -6,6 +6,7 @@
|
| #define BASE_TEMPLATE_UTIL_H_
|
|
|
| #include <cstddef> // For size_t.
|
| +#include <type_traits>
|
|
|
| #include "build/build_config.h"
|
|
|
| @@ -56,6 +57,18 @@ template <class T> struct is_const<const T> : true_type {};
|
| template <class T> struct is_void : false_type {};
|
| template <> struct is_void<void> : true_type {};
|
|
|
| +template <typename T>
|
| +struct is_move_constructible : public std::is_constructible<T, T&&> {};
|
| +
|
| +template <typename T>
|
| +struct is_copy_constructible : public std::is_constructible<T, const T&> {};
|
| +
|
| +template <typename T>
|
| +struct is_move_only
|
| + : public std::conditional<!is_copy_constructible<T>::value,
|
| + typename is_move_constructible<T>::type,
|
| + std::false_type>::type {};
|
| +
|
| namespace internal {
|
|
|
| // Types YesType and NoType are guaranteed such that sizeof(YesType) <
|
|
|