diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-22 09:18:20 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-22 09:18:20 +0000 |
commit | dbea388552d28be8d2dcfc146a75af71d61b2beb (patch) | |
tree | 8b36fff0514319dde9ebdaa4de20e6caec6f7297 /base/template_util.h | |
parent | 248fa6ff5b8f337efcdca19134f60c81bcac5113 (diff) | |
download | chromium_src-dbea388552d28be8d2dcfc146a75af71d61b2beb.zip chromium_src-dbea388552d28be8d2dcfc146a75af71d61b2beb.tar.gz chromium_src-dbea388552d28be8d2dcfc146a75af71d61b2beb.tar.bz2 |
Remove move-only-type whitelists in CallbackParamTraits and CallbackForward by SFINAE
So that all move-only types defined with MOVE_ONLY_TYPE_FOR_CPP03 automatically
becomes Passable in bind and callbacks.
BUG=none
R=ajwong@chromium.org, awong
Review URL: https://codereview.chromium.org/26848010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230080 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/template_util.h')
-rw-r--r-- | base/template_util.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/base/template_util.h b/base/template_util.h index e21d4dc..30572f1 100644 --- a/base/template_util.h +++ b/base/template_util.h @@ -39,6 +39,9 @@ template <class T> struct is_non_const_reference : false_type {}; template <class T> struct is_non_const_reference<T&> : true_type {}; template <class T> struct is_non_const_reference<const T&> : false_type {}; +template <class T> struct is_const : false_type {}; +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 {}; @@ -103,6 +106,12 @@ struct is_class sizeof(internal::YesType)> { }; +template<bool B, class T = void> +struct enable_if {}; + +template<class T> +struct enable_if<true, T> { typedef T type; }; + } // namespace base #endif // BASE_TEMPLATE_UTIL_H_ |