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

Unified Diff: mojo/services/files/public/c/lib/template_util.h

Issue 1388413005: Move //mojo/services/X/public/... to //mojo/services/X/... (part 1). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/files/public/c/lib/singletons.cc ('k') | mojo/services/files/public/c/lib/util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/files/public/c/lib/template_util.h
diff --git a/mojo/services/files/public/c/lib/template_util.h b/mojo/services/files/public/c/lib/template_util.h
deleted file mode 100644
index d5fcb2bfb15d05197ea8e537887292d66c580516..0000000000000000000000000000000000000000
--- a/mojo/services/files/public/c/lib/template_util.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SERVICES_FILES_C_LIB_TEMPLATE_UTIL_H_
-#define SERVICES_FILES_C_LIB_TEMPLATE_UTIL_H_
-
-namespace mojio {
-
-// TODO(vtl): Stuff copied from mojo/public/cpp/bindings/lib/template_util.h.
-template <class T, T v>
-struct IntegralConstant {
- static const T value = v;
-};
-
-template <class T, T v>
-const T IntegralConstant<T, v>::value;
-
-typedef IntegralConstant<bool, true> TrueType;
-typedef IntegralConstant<bool, false> FalseType;
-
-template <class T>
-struct IsConst : FalseType {};
-template <class T>
-struct IsConst<const T> : TrueType {};
-
-template <bool B, typename T = void>
-struct EnableIf {};
-
-template <typename T>
-struct EnableIf<true, T> {
- typedef T type;
-};
-
-typedef char YesType;
-
-struct NoType {
- YesType dummy[2];
-};
-
-template <typename T>
-struct IsMoveOnlyType {
- template <typename U>
- static YesType Test(const typename U::MoveOnlyTypeForCPP03*);
-
- template <typename U>
- static NoType Test(...);
-
- static const bool value =
- sizeof(Test<T>(0)) == sizeof(YesType) && !IsConst<T>::value;
-};
-
-template <typename T>
-typename EnableIf<!IsMoveOnlyType<T>::value, T>::type& Forward(T& t) {
- return t;
-}
-
-template <typename T>
-typename EnableIf<IsMoveOnlyType<T>::value, T>::type Forward(T& t) {
- return t.Pass();
-}
-// TODO(vtl): (End of stuff copied from template_util.h.)
-
-template <typename T1>
-mojo::Callback<void(T1)> Capture(T1* t1) {
- return [t1](T1 got_t1) { *t1 = Forward(got_t1); };
-}
-
-template <typename T1, typename T2>
-mojo::Callback<void(T1, T2)> Capture(T1* t1, T2* t2) {
- return [t1, t2](T1 got_t1, T2 got_t2) {
- *t1 = Forward(got_t1);
- *t2 = Forward(got_t2);
- };
-}
-
-} // namespace mojio
-
-#endif // SERVICES_FILES_C_LIB_TEMPLATE_UTIL_H_
« no previous file with comments | « mojo/services/files/public/c/lib/singletons.cc ('k') | mojo/services/files/public/c/lib/util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698