Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Side by Side Diff: include/private/SkUtility.h

Issue 1330503006: Add skstd::unique_ptr and use it. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Formatting. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/private/SkUniquePtr.h ('k') | tests/CPlusPlusEleven.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkUtility_DEFINED
9 #define SkUtility_DEFINED
10
11 #include "SkTLogic.h"
12
13 namespace skstd {
14
15 template <typename T> inline remove_reference_t<T>&& move(T&& t) {
16 return static_cast<remove_reference_t<T>&&>(t);
17 }
18
19 template <typename T> inline T&& forward(remove_reference_t<T>& t) /*noexcept*/ {
20 return static_cast<T&&>(t);
21 }
22 template <typename T> inline T&& forward(remove_reference_t<T>&& t) /*noexcept*/ {
23 static_assert(!is_lvalue_reference<T>::value,
24 "Forwarding an rvalue reference as an lvalue reference is not allowed.");
25 return static_cast<T&&>(t);
26 }
27
28 template <typename T> add_rvalue_reference_t<T> declval();
29
30 } // namespace skstd
31
32 #endif
OLDNEW
« no previous file with comments | « include/private/SkUniquePtr.h ('k') | tests/CPlusPlusEleven.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698