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

Side by Side Diff: third_party/WebKit/Source/wtf/Optional.h

Issue 1528323002: Include <algorithm> if you use functions from <algorithm>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split ui parts into a separate review Created 5 years 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef Optional_h 5 #ifndef Optional_h
6 #define Optional_h 6 #define Optional_h
7 7
8 #include "wtf/Alignment.h" 8 #include "wtf/Alignment.h"
9 #include "wtf/Assertions.h" 9 #include "wtf/Assertions.h"
10 #include "wtf/Noncopyable.h" 10 #include "wtf/Noncopyable.h"
11 #include "wtf/StdLibExtras.h" 11 #include "wtf/StdLibExtras.h"
12 #include "wtf/Utility.h" 12 #include "wtf/Utility.h"
13 13
14 #include <new>
15
14 namespace WTF { 16 namespace WTF {
15 17
16 // This is a lightweight template similar to std::experimental::optional. 18 // This is a lightweight template similar to std::experimental::optional.
17 // It currently does not support assignment, swapping, comparison, etc. 19 // It currently does not support assignment, swapping, comparison, etc.
18 // 20 //
19 // Use this instead of OwnPtr for cases where you only want to conditionally 21 // Use this instead of OwnPtr for cases where you only want to conditionally
20 // construct a "scope" object. 22 // construct a "scope" object.
21 // 23 //
22 // Example: 24 // Example:
23 // Optional<DrawingRecorder> recorder; 25 // Optional<DrawingRecorder> recorder;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 private: 60 private:
59 T* m_ptr; 61 T* m_ptr;
60 AlignedBuffer<sizeof(T), WTF_ALIGN_OF(T)> m_storage; 62 AlignedBuffer<sizeof(T), WTF_ALIGN_OF(T)> m_storage;
61 }; 63 };
62 64
63 } // namespace WTF 65 } // namespace WTF
64 66
65 using WTF::Optional; 67 using WTF::Optional;
66 68
67 #endif // Optional_h 69 #endif // Optional_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/ScriptRunIterator.cpp ('k') | third_party/WebKit/Source/wtf/text/StringBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698