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

Side by Side Diff: mojo/public/cpp/system/macros.h

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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 | « mojo/public/cpp/system/handle.h ('k') | mojo/public/cpp/system/message_pipe.h » ('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 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_
6 #define MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_
7
8 #include "mojo/public/c/system/macros.h"
9
10 // Define a set of C++ specific macros.
11 // Mojo C++ API users can assume that mojo/public/cpp/system/macros.h
12 // includes mojo/public/c/system/macros.h.
13
14 // A macro to disallow the copy constructor and operator= functions.
15 // This should be used in the private: declarations for a class.
16 #define MOJO_DISALLOW_COPY_AND_ASSIGN(TypeName) \
17 TypeName(const TypeName&); \
18 void operator=(const TypeName&)
19
20 // Used to calculate the number of elements in an array.
21 // (See |arraysize()| in Chromium's base/basictypes.h for more details.)
22 namespace mojo {
23 template <typename T, size_t N>
24 char(&ArraySizeHelper(T(&array)[N]))[N];
25 #if !defined(_MSC_VER)
26 template <typename T, size_t N>
27 char(&ArraySizeHelper(const T(&array)[N]))[N];
28 #endif
29 } // namespace mojo
30 #define MOJO_ARRAYSIZE(array) (sizeof(::mojo::ArraySizeHelper(array)))
31
32 // Used to make a type move-only. See Chromium's base/move.h for more
33 // details. The MoveOnlyTypeForCPP03 typedef is for Chromium's base/callback to
34 // tell that this type is move-only.
35 #define MOJO_MOVE_ONLY_TYPE(type) \
36 private: \
37 type(type&); \
38 void operator=(type&); \
39 \
40 public: \
41 type&& Pass() MOJO_WARN_UNUSED_RESULT { return static_cast<type&&>(*this); } \
42 typedef void MoveOnlyTypeForCPP03; \
43 \
44 private:
45 #endif // MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/system/handle.h ('k') | mojo/public/cpp/system/message_pipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698