diff options
author | 2016-01-05 14:59:40 -0800 | |
---|---|---|
committer | 2016-01-05 14:59:40 -0800 | |
commit | 221524de3be1fc343ad328c5e99562f32b5cad9c (patch) | |
tree | d9b791db0ff48921388d2b7443fd5fc58f0b9583 /include/private/SkUtility.h | |
parent | 3c1468188924ede1e6589cddee84031c16782226 (diff) |
Start using <type_traits> and <utility> (C++11).
SkUtility.h and SkTLogic.h implement a number of type traits now
available through <type_traits> and <utility>. This removes SkUtility.h,
replacing it with <utility>, and moves a number of traits in
SkTLogic.h to use the std:: equivelents. This change only uses C++11
parts of the standard library; SkTLogic.h will continue to provide
C++14 and beyond for now in the skstd namespace.
The changes to SkTLogic.h are being done gradually so that safe changes
may be landed confidently, with more risky changes in the future.
Review URL: https://codereview.chromium.org/1561683002
Diffstat (limited to 'include/private/SkUtility.h')
-rw-r--r-- | include/private/SkUtility.h | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/include/private/SkUtility.h b/include/private/SkUtility.h deleted file mode 100644 index a96e8fe292..0000000000 --- a/include/private/SkUtility.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef SkUtility_DEFINED -#define SkUtility_DEFINED - -#include "SkTLogic.h" - -namespace skstd { - -template <typename T> inline remove_reference_t<T>&& move(T&& t) { - return static_cast<remove_reference_t<T>&&>(t); -} - -template <typename T> inline T&& forward(remove_reference_t<T>& t) /*noexcept*/ { - return static_cast<T&&>(t); -} -template <typename T> inline T&& forward(remove_reference_t<T>&& t) /*noexcept*/ { - static_assert(!is_lvalue_reference<T>::value, - "Forwarding an rvalue reference as an lvalue reference is not allowed."); - return static_cast<T&&>(t); -} - -template <typename T> add_rvalue_reference_t<T> declval(); - -} // namespace skstd - -#endif |