OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project 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 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 struct Maybe { | 888 struct Maybe { |
889 Maybe() : has_value(false) {} | 889 Maybe() : has_value(false) {} |
890 explicit Maybe(T t) : has_value(true), value(t) {} | 890 explicit Maybe(T t) : has_value(true), value(t) {} |
891 Maybe(bool has, T t) : has_value(has), value(t) {} | 891 Maybe(bool has, T t) : has_value(has), value(t) {} |
892 | 892 |
893 bool has_value; | 893 bool has_value; |
894 T value; | 894 T value; |
895 }; | 895 }; |
896 | 896 |
897 | 897 |
| 898 // Convenience wrapper. |
| 899 template <class T> |
| 900 inline Maybe<T> maybe(T t) { |
| 901 return Maybe<T>(t); |
| 902 } |
| 903 |
| 904 |
898 // --- Special objects --- | 905 // --- Special objects --- |
899 | 906 |
900 | 907 |
901 /** | 908 /** |
902 * The superclass of values and API object templates. | 909 * The superclass of values and API object templates. |
903 */ | 910 */ |
904 class V8_EXPORT Data { | 911 class V8_EXPORT Data { |
905 private: | 912 private: |
906 Data(); | 913 Data(); |
907 }; | 914 }; |
(...skipping 5854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6762 */ | 6769 */ |
6763 | 6770 |
6764 | 6771 |
6765 } // namespace v8 | 6772 } // namespace v8 |
6766 | 6773 |
6767 | 6774 |
6768 #undef TYPE_CHECK | 6775 #undef TYPE_CHECK |
6769 | 6776 |
6770 | 6777 |
6771 #endif // V8_H_ | 6778 #endif // V8_H_ |
OLD | NEW |