grpc 1.73.0 → 1.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (499) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +38 -17
  3. data/include/grpc/create_channel_from_endpoint.h +54 -0
  4. data/include/grpc/credentials.h +11 -5
  5. data/include/grpc/event_engine/event_engine.h +74 -17
  6. data/include/grpc/grpc_posix.h +20 -1
  7. data/include/grpc/impl/channel_arg_names.h +2 -4
  8. data/include/grpc/module.modulemap +1 -0
  9. data/include/grpc/support/json.h +24 -0
  10. data/src/core/call/interception_chain.h +7 -11
  11. data/src/core/channelz/channel_trace.cc +213 -115
  12. data/src/core/channelz/channel_trace.h +380 -86
  13. data/src/core/channelz/channelz.cc +270 -181
  14. data/src/core/channelz/channelz.h +168 -55
  15. data/src/core/channelz/channelz_registry.cc +2 -1
  16. data/src/core/channelz/channelz_registry.h +24 -0
  17. data/src/core/channelz/property_list.cc +357 -0
  18. data/src/core/channelz/property_list.h +202 -0
  19. data/src/core/channelz/ztrace_collector.h +3 -2
  20. data/src/core/client_channel/backup_poller.cc +17 -2
  21. data/src/core/client_channel/client_channel.cc +17 -28
  22. data/src/core/client_channel/client_channel_filter.cc +19 -29
  23. data/src/core/client_channel/config_selector.h +8 -2
  24. data/src/core/client_channel/dynamic_filters.cc +5 -6
  25. data/src/core/client_channel/dynamic_filters.h +1 -1
  26. data/src/core/client_channel/global_subchannel_pool.cc +4 -1
  27. data/src/core/client_channel/retry_filter.cc +21 -27
  28. data/src/core/client_channel/retry_filter.h +10 -7
  29. data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -5
  30. data/src/core/client_channel/retry_filter_legacy_call_data.h +1 -1
  31. data/src/core/client_channel/retry_interceptor.cc +30 -44
  32. data/src/core/client_channel/retry_interceptor.h +18 -17
  33. data/src/core/client_channel/retry_throttle.cc +46 -61
  34. data/src/core/client_channel/retry_throttle.h +17 -39
  35. data/src/core/client_channel/subchannel.cc +43 -19
  36. data/src/core/client_channel/subchannel.h +8 -0
  37. data/src/core/config/config_vars.cc +2 -0
  38. data/src/core/config/core_configuration.cc +1 -0
  39. data/src/core/config/core_configuration.h +11 -0
  40. data/src/core/credentials/call/call_creds_registry.h +125 -0
  41. data/src/core/credentials/call/call_creds_registry_init.cc +91 -0
  42. data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +6 -48
  43. data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.cc +86 -0
  44. data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.h +74 -0
  45. data/src/core/credentials/call/jwt_util.cc +70 -0
  46. data/src/core/credentials/call/jwt_util.h +32 -0
  47. data/src/core/credentials/transport/channel_creds_registry_init.cc +1 -1
  48. data/src/core/credentials/transport/google_default/google_default_credentials.cc +72 -4
  49. data/src/core/credentials/transport/ssl/ssl_credentials.cc +0 -1
  50. data/src/core/credentials/transport/tls/load_system_roots_supported.cc +1 -0
  51. data/src/core/credentials/transport/xds/xds_credentials.cc +0 -3
  52. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +8 -8
  53. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +16 -16
  54. data/src/core/ext/filters/http/client_authority_filter.cc +2 -4
  55. data/src/core/ext/filters/http/message_compress/compression_filter.h +25 -22
  56. data/src/core/ext/filters/http/server/http_server_filter.h +12 -11
  57. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +120 -35
  58. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +6 -5
  59. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +162 -115
  60. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +0 -3
  61. data/src/core/ext/transport/chttp2/transport/decode_huff.cc +1239 -3514
  62. data/src/core/ext/transport/chttp2/transport/decode_huff.h +1008 -1486
  63. data/src/core/ext/transport/chttp2/transport/flow_control.h +22 -17
  64. data/src/core/ext/transport/chttp2/transport/frame.cc +10 -0
  65. data/src/core/ext/transport/chttp2/transport/frame.h +2 -2
  66. data/src/core/ext/transport/chttp2/transport/frame_data.cc +1 -1
  67. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +7 -8
  68. data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +4 -5
  69. data/src/core/ext/transport/chttp2/transport/header_assembler.h +299 -0
  70. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +1 -1
  71. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +11 -5
  72. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +12 -1
  73. data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +1017 -0
  74. data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +593 -0
  75. data/src/core/ext/transport/chttp2/transport/http2_settings.h +19 -22
  76. data/{third_party/abseil-cpp/absl/strings/cord_buffer.cc → src/core/ext/transport/chttp2/transport/http2_stats_collector.cc} +14 -14
  77. data/src/core/ext/transport/chttp2/transport/http2_stats_collector.h +33 -0
  78. data/src/core/ext/transport/chttp2/transport/http2_status.h +6 -1
  79. data/src/core/ext/transport/chttp2/transport/http2_transport.cc +43 -0
  80. data/src/core/ext/transport/chttp2/transport/http2_transport.h +65 -0
  81. data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +0 -29
  82. data/src/core/ext/transport/chttp2/transport/internal.h +18 -8
  83. data/src/core/ext/transport/chttp2/transport/keepalive.cc +105 -0
  84. data/src/core/ext/transport/chttp2/transport/keepalive.h +138 -0
  85. data/src/core/ext/transport/chttp2/transport/message_assembler.h +185 -0
  86. data/src/core/ext/transport/chttp2/transport/parsing.cc +2 -4
  87. data/src/core/ext/transport/chttp2/transport/ping_callbacks.h +19 -0
  88. data/src/core/ext/transport/chttp2/transport/ping_promise.cc +151 -0
  89. data/src/core/ext/transport/chttp2/transport/ping_promise.h +180 -0
  90. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +5 -9
  91. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +11 -0
  92. data/src/core/ext/transport/chttp2/transport/stream_lists.cc +39 -1
  93. data/src/core/ext/transport/chttp2/transport/transport_common.cc +19 -0
  94. data/src/core/ext/transport/chttp2/transport/transport_common.h +27 -0
  95. data/src/core/ext/transport/chttp2/transport/writing.cc +37 -11
  96. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb.h +571 -0
  97. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.c +120 -0
  98. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.h +36 -0
  99. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +1272 -0
  100. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +312 -0
  101. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +50 -0
  102. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb.h +984 -0
  103. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.c +226 -0
  104. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.h +44 -0
  105. data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +175 -0
  106. data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +82 -0
  107. data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.c +135 -0
  108. data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.h +67 -0
  109. data/src/core/filter/auth/auth_filters.h +0 -25
  110. data/src/core/filter/auth/client_auth_filter.cc +0 -118
  111. data/src/core/filter/filter_args.h +9 -23
  112. data/src/core/handshaker/handshaker.cc +23 -14
  113. data/src/core/handshaker/handshaker.h +3 -0
  114. data/src/core/handshaker/http_connect/http_connect_handshaker.cc +3 -1
  115. data/src/core/handshaker/security/legacy_secure_endpoint.cc +6 -5
  116. data/src/core/handshaker/security/secure_endpoint.cc +70 -25
  117. data/src/core/handshaker/security/security_handshaker.cc +4 -1
  118. data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +7 -1
  119. data/src/core/lib/channel/channel_args.cc +15 -0
  120. data/src/core/lib/channel/channel_args.h +3 -0
  121. data/src/core/lib/channel/channel_stack.cc +22 -23
  122. data/src/core/lib/channel/channel_stack.h +9 -7
  123. data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
  124. data/src/core/lib/channel/channel_stack_builder_impl.h +2 -7
  125. data/src/core/lib/channel/promise_based_filter.h +5 -5
  126. data/src/core/lib/debug/trace_impl.h +0 -1
  127. data/src/core/lib/event_engine/ares_resolver.cc +165 -46
  128. data/src/core/lib/event_engine/ares_resolver.h +48 -2
  129. data/src/core/lib/event_engine/cf_engine/cf_engine.cc +3 -1
  130. data/src/core/lib/event_engine/cf_engine/cf_engine.h +1 -4
  131. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +2 -6
  132. data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.cc +40 -0
  133. data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.h +60 -0
  134. data/src/core/lib/event_engine/event_engine.cc +7 -0
  135. data/src/core/lib/event_engine/extensions/channelz.h +10 -6
  136. data/src/core/lib/event_engine/grpc_polled_fd.h +5 -0
  137. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +130 -162
  138. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +11 -15
  139. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +75 -117
  140. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +7 -9
  141. data/src/core/lib/event_engine/posix_engine/event_poller.h +18 -15
  142. data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +0 -18
  143. data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +124 -0
  144. data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.h +243 -0
  145. data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +29 -19
  146. data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +6 -2
  147. data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +6 -1
  148. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +145 -92
  149. data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +9 -19
  150. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +333 -116
  151. data/src/core/lib/event_engine/posix_engine/posix_engine.h +61 -18
  152. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +45 -37
  153. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +6 -4
  154. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +32 -142
  155. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -5
  156. data/src/core/lib/event_engine/posix_engine/posix_interface.h +211 -0
  157. data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +1083 -0
  158. data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +281 -0
  159. data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.cc +154 -0
  160. data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.h +174 -0
  161. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +3 -719
  162. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +10 -170
  163. data/src/core/lib/event_engine/posix_engine/timer_manager.cc +33 -22
  164. data/src/core/lib/event_engine/posix_engine/timer_manager.h +13 -11
  165. data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +117 -151
  166. data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +26 -94
  167. data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +26 -25
  168. data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +6 -2
  169. data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +36 -62
  170. data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +6 -2
  171. data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +7 -6
  172. data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +12 -6
  173. data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -1
  174. data/src/core/lib/event_engine/shim.cc +9 -0
  175. data/src/core/lib/event_engine/shim.h +3 -0
  176. data/src/core/lib/event_engine/thread_pool/thread_pool.h +7 -3
  177. data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +0 -17
  178. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +4 -2
  179. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +3 -2
  180. data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +4 -0
  181. data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.h +4 -0
  182. data/src/core/lib/event_engine/windows/windows_endpoint.h +2 -6
  183. data/src/core/lib/event_engine/windows/windows_engine.cc +0 -1
  184. data/src/core/lib/event_engine/windows/windows_engine.h +1 -3
  185. data/src/core/lib/event_engine/windows/windows_listener.cc +14 -2
  186. data/src/core/lib/experiments/experiments.cc +45 -93
  187. data/src/core/lib/experiments/experiments.h +21 -51
  188. data/src/core/lib/iomgr/endpoint.cc +4 -3
  189. data/src/core/lib/iomgr/endpoint.h +7 -4
  190. data/src/core/lib/iomgr/endpoint_cfstream.cc +3 -2
  191. data/src/core/lib/iomgr/ev_epoll1_linux.cc +7 -2
  192. data/src/core/lib/iomgr/ev_poll_posix.cc +7 -2
  193. data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +4 -6
  194. data/src/core/lib/iomgr/tcp_posix.cc +12 -6
  195. data/src/core/lib/iomgr/tcp_windows.cc +3 -2
  196. data/src/core/lib/promise/activity.h +1 -0
  197. data/src/core/lib/promise/arena_promise.h +23 -7
  198. data/src/core/lib/promise/detail/promise_factory.h +10 -0
  199. data/src/core/lib/promise/detail/promise_like.h +118 -11
  200. data/src/core/lib/promise/detail/promise_variant.h +50 -0
  201. data/src/core/lib/promise/detail/seq_state.h +687 -548
  202. data/src/core/lib/promise/if.h +20 -0
  203. data/src/core/lib/promise/inter_activity_latch.h +147 -0
  204. data/src/core/lib/promise/inter_activity_mutex.h +547 -0
  205. data/src/core/lib/promise/loop.h +65 -3
  206. data/src/core/lib/promise/map.h +24 -0
  207. data/src/core/lib/promise/match_promise.h +103 -0
  208. data/src/core/lib/promise/mpsc.cc +425 -0
  209. data/src/core/lib/promise/mpsc.h +490 -0
  210. data/src/core/lib/promise/party.cc +50 -1
  211. data/src/core/lib/promise/party.h +66 -1
  212. data/src/core/lib/promise/race.h +31 -0
  213. data/src/core/lib/promise/seq.h +4 -1
  214. data/src/core/lib/promise/status_flag.h +7 -0
  215. data/src/core/lib/promise/try_seq.h +4 -1
  216. data/src/core/lib/promise/wait_set.cc +28 -0
  217. data/src/core/lib/promise/wait_set.h +86 -0
  218. data/src/core/lib/resource_quota/arena.h +19 -0
  219. data/src/core/lib/slice/slice.h +5 -0
  220. data/src/core/lib/surface/channel_create.cc +88 -13
  221. data/src/core/lib/surface/channel_create.h +4 -0
  222. data/src/core/lib/surface/channel_init.cc +164 -47
  223. data/src/core/lib/surface/channel_init.h +64 -1
  224. data/src/core/lib/surface/filter_stack_call.cc +18 -9
  225. data/src/core/lib/surface/init.cc +6 -15
  226. data/src/core/lib/surface/legacy_channel.cc +3 -5
  227. data/src/core/lib/surface/legacy_channel.h +3 -1
  228. data/src/core/lib/surface/version.cc +2 -2
  229. data/src/core/lib/transport/promise_endpoint.cc +110 -0
  230. data/src/core/lib/transport/promise_endpoint.h +307 -0
  231. data/src/core/load_balancing/child_policy_handler.cc +2 -4
  232. data/src/core/load_balancing/delegating_helper.h +2 -3
  233. data/src/core/load_balancing/health_check_client.cc +1 -5
  234. data/src/core/load_balancing/lb_policy.h +1 -3
  235. data/src/core/load_balancing/oob_backend_metric.cc +1 -5
  236. data/src/core/load_balancing/pick_first/pick_first.cc +3 -0
  237. data/src/core/load_balancing/xds/cds.cc +10 -1
  238. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +2 -0
  239. data/src/core/resolver/xds/xds_config.cc +6 -3
  240. data/src/core/resolver/xds/xds_config.h +9 -4
  241. data/src/core/resolver/xds/xds_dependency_manager.cc +21 -6
  242. data/src/core/resolver/xds/xds_dependency_manager.h +2 -1
  243. data/src/core/resolver/xds/xds_resolver.cc +31 -11
  244. data/src/core/server/server.cc +83 -12
  245. data/src/core/server/server.h +21 -2
  246. data/src/core/server/xds_server_config_fetcher.cc +63 -25
  247. data/src/core/service_config/service_config.h +1 -1
  248. data/src/core/service_config/service_config_impl.h +1 -1
  249. data/src/core/telemetry/context_list_entry.cc +38 -0
  250. data/src/core/telemetry/context_list_entry.h +42 -12
  251. data/src/core/telemetry/stats_data.cc +233 -207
  252. data/src/core/telemetry/stats_data.h +250 -153
  253. data/src/core/telemetry/tcp_tracer.h +1 -1
  254. data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +11 -3
  255. data/src/core/tsi/fake_transport_security.cc +17 -0
  256. data/src/core/tsi/ssl_transport_security.cc +2 -0
  257. data/src/core/tsi/transport_security_grpc.cc +8 -0
  258. data/src/core/tsi/transport_security_grpc.h +15 -0
  259. data/src/core/util/backoff.cc +1 -5
  260. data/src/core/util/backoff.h +1 -0
  261. data/src/core/util/down_cast.h +1 -1
  262. data/src/core/util/function_signature.h +15 -1
  263. data/src/core/util/http_client/httpcli.cc +12 -5
  264. data/src/core/util/http_client/httpcli.h +4 -1
  265. data/src/core/util/latent_see.h +8 -5
  266. data/src/core/util/log.cc +4 -0
  267. data/src/core/util/memory_usage.h +268 -0
  268. data/src/core/util/per_cpu.cc +2 -0
  269. data/src/core/util/per_cpu.h +7 -0
  270. data/src/core/util/shared_bit_gen.h +20 -0
  271. data/src/core/util/single_set_ptr.h +2 -2
  272. data/src/core/util/upb_utils.h +42 -0
  273. data/src/core/util/uri.cc +3 -2
  274. data/src/core/util/useful.h +53 -2
  275. data/src/core/util/wait_for_single_owner.cc +31 -0
  276. data/src/core/util/wait_for_single_owner.h +24 -0
  277. data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -0
  278. data/src/core/xds/grpc/xds_bootstrap_grpc.h +5 -0
  279. data/src/core/xds/grpc/xds_client_grpc.cc +6 -2
  280. data/src/core/xds/grpc/xds_common_types_parser.cc +138 -50
  281. data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
  282. data/src/core/xds/grpc/xds_http_filter.h +7 -0
  283. data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +22 -0
  284. data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +3 -0
  285. data/src/core/xds/grpc/xds_route_config_parser.cc +15 -38
  286. data/src/core/xds/grpc/xds_server_grpc.cc +63 -13
  287. data/src/core/xds/grpc/xds_server_grpc.h +10 -2
  288. data/src/core/xds/grpc/xds_server_grpc_interface.h +4 -0
  289. data/src/core/xds/grpc/xds_transport_grpc.cc +18 -0
  290. data/src/core/xds/xds_client/xds_bootstrap.h +2 -0
  291. data/src/core/xds/xds_client/xds_client.cc +26 -5
  292. data/src/ruby/ext/grpc/extconf.rb +2 -0
  293. data/src/ruby/ext/grpc/rb_call.c +1 -8
  294. data/src/ruby/ext/grpc/rb_channel.c +72 -568
  295. data/src/ruby/ext/grpc/rb_channel.h +0 -3
  296. data/src/ruby/ext/grpc/rb_completion_queue.c +26 -14
  297. data/src/ruby/ext/grpc/rb_completion_queue.h +1 -7
  298. data/src/ruby/ext/grpc/rb_grpc.c +9 -5
  299. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +1 -1
  300. data/src/ruby/ext/grpc/rb_loader.c +0 -4
  301. data/src/ruby/ext/grpc/rb_server.c +31 -50
  302. data/src/ruby/lib/grpc/generic/client_stub.rb +4 -4
  303. data/src/ruby/lib/grpc/version.rb +1 -1
  304. data/src/ruby/spec/core_spec.rb +22 -0
  305. data/src/ruby/spec/generic/active_call_spec.rb +1 -1
  306. data/third_party/abseil-cpp/absl/algorithm/container.h +2 -19
  307. data/third_party/abseil-cpp/absl/base/attributes.h +76 -7
  308. data/third_party/abseil-cpp/absl/base/call_once.h +11 -12
  309. data/third_party/abseil-cpp/absl/base/config.h +20 -129
  310. data/third_party/abseil-cpp/absl/base/{internal/fast_type_id.h → fast_type_id.h} +11 -16
  311. data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +0 -5
  312. data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +7 -7
  313. data/third_party/abseil-cpp/absl/base/internal/endian.h +34 -38
  314. data/third_party/abseil-cpp/absl/base/internal/iterator_traits.h +71 -0
  315. data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +6 -5
  316. data/third_party/abseil-cpp/absl/base/internal/{nullability_impl.h → nullability_deprecated.h} +45 -8
  317. data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +0 -9
  318. data/third_party/abseil-cpp/absl/base/internal/spinlock.h +3 -13
  319. data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +6 -6
  320. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +8 -3
  321. data/third_party/abseil-cpp/absl/base/no_destructor.h +11 -32
  322. data/third_party/abseil-cpp/absl/base/nullability.h +84 -72
  323. data/third_party/abseil-cpp/absl/base/options.h +3 -80
  324. data/third_party/abseil-cpp/absl/base/policy_checks.h +7 -7
  325. data/third_party/abseil-cpp/absl/cleanup/cleanup.h +1 -3
  326. data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +3 -4
  327. data/third_party/abseil-cpp/absl/container/btree_map.h +4 -2
  328. data/third_party/abseil-cpp/absl/container/btree_set.h +4 -2
  329. data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -14
  330. data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -0
  331. data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -1
  332. data/third_party/abseil-cpp/absl/container/inlined_vector.h +8 -5
  333. data/third_party/abseil-cpp/absl/container/internal/btree.h +132 -29
  334. data/third_party/abseil-cpp/absl/container/internal/btree_container.h +175 -71
  335. data/third_party/abseil-cpp/absl/container/internal/common.h +43 -0
  336. data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -2
  337. data/third_party/abseil-cpp/absl/container/internal/container_memory.h +9 -10
  338. data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +1 -8
  339. data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +0 -4
  340. data/third_party/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +527 -0
  341. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +20 -4
  342. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +31 -12
  343. data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +2 -7
  344. data/third_party/abseil-cpp/absl/container/internal/layout.h +26 -42
  345. data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +199 -68
  346. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +1354 -183
  347. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +881 -1424
  348. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl.h +80 -0
  349. data/third_party/abseil-cpp/absl/crc/crc32c.cc +0 -4
  350. data/third_party/abseil-cpp/absl/crc/crc32c.h +7 -5
  351. data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +0 -22
  352. data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +45 -74
  353. data/third_party/abseil-cpp/absl/debugging/internal/addresses.h +57 -0
  354. data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.cc +1 -1
  355. data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.h +5 -5
  356. data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +8 -35
  357. data/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.cc +16 -16
  358. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +40 -37
  359. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +16 -7
  360. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +14 -5
  361. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +10 -4
  362. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +27 -16
  363. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +13 -4
  364. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc +4 -3
  365. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +15 -28
  366. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +19 -9
  367. data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +144 -27
  368. data/third_party/abseil-cpp/absl/debugging/stacktrace.h +73 -5
  369. data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +19 -9
  370. data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -2
  371. data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +25 -6
  372. data/third_party/abseil-cpp/absl/flags/commandlineflag.h +2 -2
  373. data/third_party/abseil-cpp/absl/flags/flag.h +4 -3
  374. data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.h +2 -2
  375. data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -1
  376. data/third_party/abseil-cpp/absl/flags/internal/flag.h +7 -6
  377. data/third_party/abseil-cpp/absl/flags/internal/registry.h +4 -3
  378. data/third_party/abseil-cpp/absl/flags/reflection.cc +2 -3
  379. data/third_party/abseil-cpp/absl/functional/any_invocable.h +8 -10
  380. data/third_party/abseil-cpp/absl/functional/function_ref.h +2 -9
  381. data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +110 -226
  382. data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +10 -12
  383. data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +2 -5
  384. data/third_party/abseil-cpp/absl/hash/hash.h +18 -0
  385. data/third_party/abseil-cpp/absl/hash/internal/hash.cc +1 -5
  386. data/third_party/abseil-cpp/absl/hash/internal/hash.h +86 -61
  387. data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +25 -68
  388. data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +2 -6
  389. data/third_party/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h +38 -0
  390. data/third_party/abseil-cpp/absl/log/check.h +2 -1
  391. data/third_party/abseil-cpp/absl/log/globals.h +4 -5
  392. data/third_party/abseil-cpp/absl/log/internal/append_truncated.h +28 -0
  393. data/third_party/abseil-cpp/absl/log/internal/check_op.cc +22 -22
  394. data/third_party/abseil-cpp/absl/log/internal/check_op.h +65 -62
  395. data/third_party/abseil-cpp/absl/log/internal/conditions.cc +5 -3
  396. data/third_party/abseil-cpp/absl/log/internal/conditions.h +7 -2
  397. data/third_party/abseil-cpp/absl/log/internal/log_message.cc +85 -43
  398. data/third_party/abseil-cpp/absl/log/internal/log_message.h +84 -59
  399. data/third_party/abseil-cpp/absl/log/internal/nullstream.h +1 -0
  400. data/third_party/abseil-cpp/absl/log/internal/proto.cc +3 -2
  401. data/third_party/abseil-cpp/absl/log/internal/proto.h +3 -3
  402. data/third_party/abseil-cpp/absl/log/internal/strip.h +4 -12
  403. data/third_party/abseil-cpp/absl/log/internal/vlog_config.h +8 -6
  404. data/third_party/abseil-cpp/absl/log/internal/voidify.h +10 -4
  405. data/third_party/abseil-cpp/absl/log/log.h +48 -35
  406. data/third_party/abseil-cpp/absl/log/log_sink_registry.h +2 -2
  407. data/third_party/abseil-cpp/absl/meta/type_traits.h +46 -175
  408. data/third_party/abseil-cpp/absl/numeric/bits.h +68 -2
  409. data/third_party/abseil-cpp/absl/numeric/int128.cc +0 -52
  410. data/third_party/abseil-cpp/absl/numeric/internal/bits.h +7 -3
  411. data/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc +1 -1
  412. data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +10 -11
  413. data/third_party/abseil-cpp/absl/random/distributions.h +6 -8
  414. data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +1 -1
  415. data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +5 -6
  416. data/third_party/abseil-cpp/absl/random/internal/{pool_urbg.cc → entropy_pool.cc} +22 -90
  417. data/third_party/abseil-cpp/absl/random/internal/entropy_pool.h +35 -0
  418. data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +5 -6
  419. data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +1 -1
  420. data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +20 -12
  421. data/third_party/abseil-cpp/absl/random/internal/seed_material.h +5 -5
  422. data/third_party/abseil-cpp/absl/random/random.h +88 -53
  423. data/third_party/abseil-cpp/absl/random/seed_sequences.cc +6 -2
  424. data/third_party/abseil-cpp/absl/status/internal/status_internal.cc +3 -4
  425. data/third_party/abseil-cpp/absl/status/internal/status_internal.h +3 -4
  426. data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +4 -3
  427. data/third_party/abseil-cpp/absl/status/status.cc +4 -8
  428. data/third_party/abseil-cpp/absl/status/status.h +8 -8
  429. data/third_party/abseil-cpp/absl/status/status_payload_printer.h +2 -2
  430. data/third_party/abseil-cpp/absl/status/statusor.cc +2 -2
  431. data/third_party/abseil-cpp/absl/status/statusor.h +6 -6
  432. data/third_party/abseil-cpp/absl/strings/ascii.cc +9 -9
  433. data/third_party/abseil-cpp/absl/strings/ascii.h +18 -18
  434. data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -22
  435. data/third_party/abseil-cpp/absl/strings/charconv.h +5 -5
  436. data/third_party/abseil-cpp/absl/strings/cord.cc +54 -58
  437. data/third_party/abseil-cpp/absl/strings/cord.h +94 -83
  438. data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +11 -11
  439. data/third_party/abseil-cpp/absl/strings/cord_analysis.h +3 -3
  440. data/third_party/abseil-cpp/absl/strings/escaping.cc +130 -149
  441. data/third_party/abseil-cpp/absl/strings/escaping.h +9 -10
  442. data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +1 -1
  443. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +6 -8
  444. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +0 -4
  445. data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +0 -4
  446. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +7 -63
  447. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +1 -11
  448. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +0 -22
  449. data/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc +5 -3
  450. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +4 -2
  451. data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +3 -3
  452. data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +0 -5
  453. data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +96 -1
  454. data/third_party/abseil-cpp/absl/strings/internal/utf8.h +15 -1
  455. data/third_party/abseil-cpp/absl/strings/numbers.cc +53 -32
  456. data/third_party/abseil-cpp/absl/strings/numbers.h +87 -58
  457. data/third_party/abseil-cpp/absl/strings/str_cat.cc +6 -7
  458. data/third_party/abseil-cpp/absl/strings/str_cat.h +32 -32
  459. data/third_party/abseil-cpp/absl/strings/str_format.h +18 -18
  460. data/third_party/abseil-cpp/absl/strings/str_replace.cc +3 -3
  461. data/third_party/abseil-cpp/absl/strings/str_replace.h +6 -6
  462. data/third_party/abseil-cpp/absl/strings/string_view.cc +4 -9
  463. data/third_party/abseil-cpp/absl/strings/string_view.h +27 -32
  464. data/third_party/abseil-cpp/absl/strings/strip.h +4 -4
  465. data/third_party/abseil-cpp/absl/strings/substitute.cc +5 -4
  466. data/third_party/abseil-cpp/absl/strings/substitute.h +66 -64
  467. data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +0 -4
  468. data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +0 -5
  469. data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +0 -4
  470. data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +0 -4
  471. data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +0 -4
  472. data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +0 -4
  473. data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +0 -4
  474. data/third_party/abseil-cpp/absl/synchronization/mutex.cc +1 -1
  475. data/third_party/abseil-cpp/absl/synchronization/mutex.h +97 -69
  476. data/third_party/abseil-cpp/absl/synchronization/notification.h +1 -1
  477. data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -0
  478. data/third_party/abseil-cpp/absl/time/duration.cc +12 -7
  479. data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -1
  480. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +90 -111
  481. data/third_party/abseil-cpp/absl/time/time.h +20 -15
  482. data/third_party/abseil-cpp/absl/types/optional.h +7 -747
  483. data/third_party/abseil-cpp/absl/types/span.h +13 -11
  484. data/third_party/abseil-cpp/absl/types/variant.h +5 -784
  485. data/third_party/abseil-cpp/absl/utility/utility.h +10 -185
  486. metadata +72 -20
  487. data/src/core/lib/event_engine/forkable.cc +0 -105
  488. data/src/core/lib/event_engine/forkable.h +0 -67
  489. data/src/core/lib/iomgr/python_util.h +0 -46
  490. data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +0 -108
  491. data/third_party/abseil-cpp/absl/base/internal/invoke.h +0 -241
  492. data/third_party/abseil-cpp/absl/log/log_entry.cc +0 -41
  493. data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +0 -131
  494. data/third_party/abseil-cpp/absl/types/bad_optional_access.cc +0 -66
  495. data/third_party/abseil-cpp/absl/types/bad_optional_access.h +0 -78
  496. data/third_party/abseil-cpp/absl/types/bad_variant_access.cc +0 -82
  497. data/third_party/abseil-cpp/absl/types/bad_variant_access.h +0 -82
  498. data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -352
  499. data/third_party/abseil-cpp/absl/types/internal/variant.h +0 -1622
@@ -16,31 +16,17 @@
16
16
  // optional.h
17
17
  // -----------------------------------------------------------------------------
18
18
  //
19
- // This header file defines the `absl::optional` type for holding a value which
20
- // may or may not be present. This type is useful for providing value semantics
21
- // for operations that may either wish to return or hold "something-or-nothing".
22
- //
23
- // Example:
24
- //
25
- // // A common way to signal operation failure is to provide an output
26
- // // parameter and a bool return type:
27
- // bool AcquireResource(const Input&, Resource * out);
28
- //
29
- // // Providing an absl::optional return type provides a cleaner API:
30
- // absl::optional<Resource> AcquireResource(const Input&);
31
- //
32
- // `absl::optional` is a C++11 compatible version of the C++17 `std::optional`
33
- // abstraction and is designed to be a drop-in replacement for code compliant
34
- // with C++17.
19
+ // Historical note: Abseil once provided an implementation of `absl::optional`
20
+ // as a polyfill for `std::optional` prior to C++17. Now that C++17 is required,
21
+ // `absl::optional` is an alias for `std::optional`.
22
+
35
23
  #ifndef ABSL_TYPES_OPTIONAL_H_
36
24
  #define ABSL_TYPES_OPTIONAL_H_
37
25
 
38
- #include "absl/base/config.h" // TODO(calabrese) IWYU removal?
39
- #include "absl/utility/utility.h"
40
-
41
- #ifdef ABSL_USES_STD_OPTIONAL
26
+ #include <optional>
42
27
 
43
- #include <optional> // IWYU pragma: export
28
+ #include "absl/base/config.h"
29
+ #include "absl/utility/utility.h"
44
30
 
45
31
  namespace absl {
46
32
  ABSL_NAMESPACE_BEGIN
@@ -52,730 +38,4 @@ using std::nullopt;
52
38
  ABSL_NAMESPACE_END
53
39
  } // namespace absl
54
40
 
55
- #else // ABSL_USES_STD_OPTIONAL
56
-
57
- #include <cassert>
58
- #include <functional>
59
- #include <initializer_list>
60
- #include <type_traits>
61
- #include <utility>
62
-
63
- #include "absl/base/attributes.h"
64
- #include "absl/base/nullability.h"
65
- #include "absl/base/internal/inline_variable.h"
66
- #include "absl/meta/type_traits.h"
67
- #include "absl/types/bad_optional_access.h"
68
- #include "absl/types/internal/optional.h"
69
-
70
- namespace absl {
71
- ABSL_NAMESPACE_BEGIN
72
-
73
- // nullopt_t
74
- //
75
- // Class type for `absl::nullopt` used to indicate an `absl::optional<T>` type
76
- // that does not contain a value.
77
- struct nullopt_t {
78
- // It must not be default-constructible to avoid ambiguity for opt = {}.
79
- explicit constexpr nullopt_t(optional_internal::init_t) noexcept {}
80
- };
81
-
82
- // nullopt
83
- //
84
- // A tag constant of type `absl::nullopt_t` used to indicate an empty
85
- // `absl::optional` in certain functions, such as construction or assignment.
86
- ABSL_INTERNAL_INLINE_CONSTEXPR(nullopt_t, nullopt,
87
- nullopt_t(optional_internal::init_t()));
88
-
89
- // -----------------------------------------------------------------------------
90
- // absl::optional
91
- // -----------------------------------------------------------------------------
92
- //
93
- // A value of type `absl::optional<T>` holds either a value of `T` or an
94
- // "empty" value. When it holds a value of `T`, it stores it as a direct
95
- // sub-object, so `sizeof(optional<T>)` is approximately
96
- // `sizeof(T) + sizeof(bool)`.
97
- //
98
- // This implementation is based on the specification in the latest draft of the
99
- // C++17 `std::optional` specification as of May 2017, section 20.6.
100
- //
101
- // Differences between `absl::optional<T>` and `std::optional<T>` include:
102
- //
103
- // * `constexpr` is not used for non-const member functions.
104
- // (dependency on some differences between C++11 and C++14.)
105
- // * `absl::nullopt` and `absl::in_place` are not declared `constexpr`. We
106
- // need the inline variable support in C++17 for external linkage.
107
- // * Throws `absl::bad_optional_access` instead of
108
- // `std::bad_optional_access`.
109
- // * `make_optional()` cannot be declared `constexpr` due to the absence of
110
- // guaranteed copy elision.
111
- // * The move constructor's `noexcept` specification is stronger, i.e. if the
112
- // default allocator is non-throwing (via setting
113
- // `ABSL_ALLOCATOR_NOTHROW`), it evaluates to `noexcept(true)`, because
114
- // we assume
115
- // a) move constructors should only throw due to allocation failure and
116
- // b) if T's move constructor allocates, it uses the same allocation
117
- // function as the default allocator.
118
- //
119
- template <typename T>
120
- class optional : private optional_internal::optional_data<T>,
121
- private optional_internal::optional_ctor_base<
122
- optional_internal::ctor_copy_traits<T>::traits>,
123
- private optional_internal::optional_assign_base<
124
- optional_internal::assign_copy_traits<T>::traits> {
125
- using data_base = optional_internal::optional_data<T>;
126
-
127
- public:
128
- typedef T value_type;
129
-
130
- // Constructors
131
-
132
- // Constructs an `optional` holding an empty value, NOT a default constructed
133
- // `T`.
134
- constexpr optional() noexcept = default;
135
-
136
- // Constructs an `optional` initialized with `nullopt` to hold an empty value.
137
- constexpr optional(nullopt_t) noexcept {} // NOLINT(runtime/explicit)
138
-
139
- // Copy constructor, standard semantics
140
- optional(const optional&) = default;
141
-
142
- // Move constructor, standard semantics
143
- optional(optional&&) = default;
144
-
145
- // Constructs a non-empty `optional` direct-initialized value of type `T` from
146
- // the arguments `std::forward<Args>(args)...` within the `optional`.
147
- // (The `in_place_t` is a tag used to indicate that the contained object
148
- // should be constructed in-place.)
149
- template <typename InPlaceT, typename... Args,
150
- absl::enable_if_t<absl::conjunction<
151
- std::is_same<InPlaceT, in_place_t>,
152
- std::is_constructible<T, Args&&...> >::value>* = nullptr>
153
- constexpr explicit optional(InPlaceT, Args&&... args)
154
- : data_base(in_place_t(), std::forward<Args>(args)...) {}
155
-
156
- // Constructs a non-empty `optional` direct-initialized value of type `T` from
157
- // the arguments of an initializer_list and `std::forward<Args>(args)...`.
158
- // (The `in_place_t` is a tag used to indicate that the contained object
159
- // should be constructed in-place.)
160
- template <typename U, typename... Args,
161
- typename = typename std::enable_if<std::is_constructible<
162
- T, std::initializer_list<U>&, Args&&...>::value>::type>
163
- constexpr explicit optional(in_place_t, std::initializer_list<U> il,
164
- Args&&... args)
165
- : data_base(in_place_t(), il, std::forward<Args>(args)...) {}
166
-
167
- // Value constructor (implicit)
168
- template <
169
- typename U = T,
170
- typename std::enable_if<
171
- absl::conjunction<absl::negation<std::is_same<
172
- in_place_t, typename std::decay<U>::type> >,
173
- absl::negation<std::is_same<
174
- optional<T>, typename std::decay<U>::type> >,
175
- std::is_convertible<U&&, T>,
176
- std::is_constructible<T, U&&> >::value,
177
- bool>::type = false>
178
- constexpr optional(U&& v) : data_base(in_place_t(), std::forward<U>(v)) {}
179
-
180
- // Value constructor (explicit)
181
- template <
182
- typename U = T,
183
- typename std::enable_if<
184
- absl::conjunction<absl::negation<std::is_same<
185
- in_place_t, typename std::decay<U>::type> >,
186
- absl::negation<std::is_same<
187
- optional<T>, typename std::decay<U>::type> >,
188
- absl::negation<std::is_convertible<U&&, T> >,
189
- std::is_constructible<T, U&&> >::value,
190
- bool>::type = false>
191
- explicit constexpr optional(U&& v)
192
- : data_base(in_place_t(), std::forward<U>(v)) {}
193
-
194
- // Converting copy constructor (implicit)
195
- template <typename U,
196
- typename std::enable_if<
197
- absl::conjunction<
198
- absl::negation<std::is_same<T, U> >,
199
- std::is_constructible<T, const U&>,
200
- absl::negation<
201
- optional_internal::
202
- is_constructible_convertible_from_optional<T, U> >,
203
- std::is_convertible<const U&, T> >::value,
204
- bool>::type = false>
205
- optional(const optional<U>& rhs) {
206
- if (rhs) {
207
- this->construct(*rhs);
208
- }
209
- }
210
-
211
- // Converting copy constructor (explicit)
212
- template <typename U,
213
- typename std::enable_if<
214
- absl::conjunction<
215
- absl::negation<std::is_same<T, U>>,
216
- std::is_constructible<T, const U&>,
217
- absl::negation<
218
- optional_internal::
219
- is_constructible_convertible_from_optional<T, U>>,
220
- absl::negation<std::is_convertible<const U&, T>>>::value,
221
- bool>::type = false>
222
- explicit optional(const optional<U>& rhs) {
223
- if (rhs) {
224
- this->construct(*rhs);
225
- }
226
- }
227
-
228
- // Converting move constructor (implicit)
229
- template <typename U,
230
- typename std::enable_if<
231
- absl::conjunction<
232
- absl::negation<std::is_same<T, U> >,
233
- std::is_constructible<T, U&&>,
234
- absl::negation<
235
- optional_internal::
236
- is_constructible_convertible_from_optional<T, U> >,
237
- std::is_convertible<U&&, T> >::value,
238
- bool>::type = false>
239
- optional(optional<U>&& rhs) {
240
- if (rhs) {
241
- this->construct(std::move(*rhs));
242
- }
243
- }
244
-
245
- // Converting move constructor (explicit)
246
- template <
247
- typename U,
248
- typename std::enable_if<
249
- absl::conjunction<
250
- absl::negation<std::is_same<T, U>>, std::is_constructible<T, U&&>,
251
- absl::negation<
252
- optional_internal::is_constructible_convertible_from_optional<
253
- T, U>>,
254
- absl::negation<std::is_convertible<U&&, T>>>::value,
255
- bool>::type = false>
256
- explicit optional(optional<U>&& rhs) {
257
- if (rhs) {
258
- this->construct(std::move(*rhs));
259
- }
260
- }
261
-
262
- // Destructor. Trivial if `T` is trivially destructible.
263
- ~optional() = default;
264
-
265
- // Assignment Operators
266
-
267
- // Assignment from `nullopt`
268
- //
269
- // Example:
270
- //
271
- // struct S { int value; };
272
- // optional<S> opt = absl::nullopt; // Could also use opt = { };
273
- optional& operator=(nullopt_t) noexcept {
274
- this->destruct();
275
- return *this;
276
- }
277
-
278
- // Copy assignment operator, standard semantics
279
- optional& operator=(const optional& src) = default;
280
-
281
- // Move assignment operator, standard semantics
282
- optional& operator=(optional&& src) = default;
283
-
284
- // Value assignment operators
285
- template <typename U = T,
286
- int&..., // Workaround an internal compiler error in GCC 5 to 10.
287
- typename = typename std::enable_if<absl::conjunction<
288
- absl::negation<
289
- std::is_same<optional<T>, typename std::decay<U>::type> >,
290
- absl::negation<absl::conjunction<
291
- std::is_scalar<T>,
292
- std::is_same<T, typename std::decay<U>::type> > >,
293
- std::is_constructible<T, U>,
294
- std::is_assignable<T&, U> >::value>::type>
295
- optional& operator=(U&& v) {
296
- this->assign(std::forward<U>(v));
297
- return *this;
298
- }
299
-
300
- template <
301
- typename U,
302
- int&..., // Workaround an internal compiler error in GCC 5 to 10.
303
- typename = typename std::enable_if<absl::conjunction<
304
- absl::negation<std::is_same<T, U> >,
305
- std::is_constructible<T, const U&>, std::is_assignable<T&, const U&>,
306
- absl::negation<
307
- optional_internal::
308
- is_constructible_convertible_assignable_from_optional<
309
- T, U> > >::value>::type>
310
- optional& operator=(const optional<U>& rhs) {
311
- if (rhs) {
312
- this->assign(*rhs);
313
- } else {
314
- this->destruct();
315
- }
316
- return *this;
317
- }
318
-
319
- template <typename U,
320
- int&..., // Workaround an internal compiler error in GCC 5 to 10.
321
- typename = typename std::enable_if<absl::conjunction<
322
- absl::negation<std::is_same<T, U> >,
323
- std::is_constructible<T, U>, std::is_assignable<T&, U>,
324
- absl::negation<
325
- optional_internal::
326
- is_constructible_convertible_assignable_from_optional<
327
- T, U> > >::value>::type>
328
- optional& operator=(optional<U>&& rhs) {
329
- if (rhs) {
330
- this->assign(std::move(*rhs));
331
- } else {
332
- this->destruct();
333
- }
334
- return *this;
335
- }
336
-
337
- // Modifiers
338
-
339
- // optional::reset()
340
- //
341
- // Destroys the inner `T` value of an `absl::optional` if one is present.
342
- ABSL_ATTRIBUTE_REINITIALIZES void reset() noexcept { this->destruct(); }
343
-
344
- // optional::emplace()
345
- //
346
- // (Re)constructs the underlying `T` in-place with the given forwarded
347
- // arguments.
348
- //
349
- // Example:
350
- //
351
- // optional<Foo> opt;
352
- // opt.emplace(arg1,arg2,arg3); // Constructs Foo(arg1,arg2,arg3)
353
- //
354
- // If the optional is non-empty, and the `args` refer to subobjects of the
355
- // current object, then behaviour is undefined, because the current object
356
- // will be destructed before the new object is constructed with `args`.
357
- template <typename... Args,
358
- typename = typename std::enable_if<
359
- std::is_constructible<T, Args&&...>::value>::type>
360
- T& emplace(Args&&... args) ABSL_ATTRIBUTE_LIFETIME_BOUND {
361
- this->destruct();
362
- this->construct(std::forward<Args>(args)...);
363
- return reference();
364
- }
365
-
366
- // Emplace reconstruction overload for an initializer list and the given
367
- // forwarded arguments.
368
- //
369
- // Example:
370
- //
371
- // struct Foo {
372
- // Foo(std::initializer_list<int>);
373
- // };
374
- //
375
- // optional<Foo> opt;
376
- // opt.emplace({1,2,3}); // Constructs Foo({1,2,3})
377
- template <typename U, typename... Args,
378
- typename = typename std::enable_if<std::is_constructible<
379
- T, std::initializer_list<U>&, Args&&...>::value>::type>
380
- T& emplace(std::initializer_list<U> il,
381
- Args&&... args) ABSL_ATTRIBUTE_LIFETIME_BOUND {
382
- this->destruct();
383
- this->construct(il, std::forward<Args>(args)...);
384
- return reference();
385
- }
386
-
387
- // Swaps
388
-
389
- // Swap, standard semantics
390
- void swap(optional& rhs) noexcept(
391
- std::is_nothrow_move_constructible<T>::value&&
392
- type_traits_internal::IsNothrowSwappable<T>::value) {
393
- if (*this) {
394
- if (rhs) {
395
- type_traits_internal::Swap(**this, *rhs);
396
- } else {
397
- rhs.construct(std::move(**this));
398
- this->destruct();
399
- }
400
- } else {
401
- if (rhs) {
402
- this->construct(std::move(*rhs));
403
- rhs.destruct();
404
- } else {
405
- // No effect (swap(disengaged, disengaged)).
406
- }
407
- }
408
- }
409
-
410
- // Observers
411
-
412
- // optional::operator->()
413
- //
414
- // Accesses the underlying `T` value's member `m` of an `optional`. If the
415
- // `optional` is empty, behavior is undefined.
416
- //
417
- // If you need myOpt->foo in constexpr, use (*myOpt).foo instead.
418
- absl::Nonnull<const T*> operator->() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
419
- ABSL_HARDENING_ASSERT(this->engaged_);
420
- return std::addressof(this->data_);
421
- }
422
- absl::Nonnull<T*> operator->() ABSL_ATTRIBUTE_LIFETIME_BOUND {
423
- ABSL_HARDENING_ASSERT(this->engaged_);
424
- return std::addressof(this->data_);
425
- }
426
-
427
- // optional::operator*()
428
- //
429
- // Accesses the underlying `T` value of an `optional`. If the `optional` is
430
- // empty, behavior is undefined.
431
- constexpr const T& operator*() const& ABSL_ATTRIBUTE_LIFETIME_BOUND {
432
- ABSL_HARDENING_ASSERT(this->engaged_);
433
- return reference();
434
- }
435
- T& operator*() & ABSL_ATTRIBUTE_LIFETIME_BOUND {
436
- ABSL_HARDENING_ASSERT(this->engaged_);
437
- return reference();
438
- }
439
- constexpr const T&& operator*() const&& ABSL_ATTRIBUTE_LIFETIME_BOUND {
440
- ABSL_HARDENING_ASSERT(this->engaged_);
441
- return std::move(reference());
442
- }
443
- T&& operator*() && ABSL_ATTRIBUTE_LIFETIME_BOUND {
444
- ABSL_HARDENING_ASSERT(this->engaged_);
445
- return std::move(reference());
446
- }
447
-
448
- // optional::operator bool()
449
- //
450
- // Returns false if and only if the `optional` is empty.
451
- //
452
- // if (opt) {
453
- // // do something with *opt or opt->;
454
- // } else {
455
- // // opt is empty.
456
- // }
457
- //
458
- constexpr explicit operator bool() const noexcept { return this->engaged_; }
459
-
460
- // optional::has_value()
461
- //
462
- // Determines whether the `optional` contains a value. Returns `false` if and
463
- // only if `*this` is empty.
464
- constexpr bool has_value() const noexcept { return this->engaged_; }
465
-
466
- // Suppress bogus warning on MSVC: MSVC complains call to reference() after
467
- // throw_bad_optional_access() is unreachable.
468
- #ifdef _MSC_VER
469
- #pragma warning(push)
470
- #pragma warning(disable : 4702)
471
- #endif // _MSC_VER
472
- // optional::value()
473
- //
474
- // Returns a reference to an `optional`s underlying value. The constness
475
- // and lvalue/rvalue-ness of the `optional` is preserved to the view of
476
- // the `T` sub-object. Throws `absl::bad_optional_access` when the `optional`
477
- // is empty.
478
- constexpr const T& value() const& ABSL_ATTRIBUTE_LIFETIME_BOUND {
479
- return static_cast<bool>(*this)
480
- ? reference()
481
- : (optional_internal::throw_bad_optional_access(), reference());
482
- }
483
- T& value() & ABSL_ATTRIBUTE_LIFETIME_BOUND {
484
- return static_cast<bool>(*this)
485
- ? reference()
486
- : (optional_internal::throw_bad_optional_access(), reference());
487
- }
488
- T&& value() && ABSL_ATTRIBUTE_LIFETIME_BOUND { // NOLINT(build/c++11)
489
- return std::move(
490
- static_cast<bool>(*this)
491
- ? reference()
492
- : (optional_internal::throw_bad_optional_access(), reference()));
493
- }
494
- constexpr const T&& value()
495
- const&& ABSL_ATTRIBUTE_LIFETIME_BOUND { // NOLINT(build/c++11)
496
- return std::move(
497
- static_cast<bool>(*this)
498
- ? reference()
499
- : (optional_internal::throw_bad_optional_access(), reference()));
500
- }
501
- #ifdef _MSC_VER
502
- #pragma warning(pop)
503
- #endif // _MSC_VER
504
-
505
- // optional::value_or()
506
- //
507
- // Returns either the value of `T` or a passed default `v` if the `optional`
508
- // is empty.
509
- template <typename U>
510
- constexpr T value_or(U&& v) const& {
511
- static_assert(std::is_copy_constructible<value_type>::value,
512
- "optional<T>::value_or: T must be copy constructible");
513
- static_assert(std::is_convertible<U&&, value_type>::value,
514
- "optional<T>::value_or: U must be convertible to T");
515
- return static_cast<bool>(*this) ? **this
516
- : static_cast<T>(std::forward<U>(v));
517
- }
518
- template <typename U>
519
- T value_or(U&& v) && { // NOLINT(build/c++11)
520
- static_assert(std::is_move_constructible<value_type>::value,
521
- "optional<T>::value_or: T must be move constructible");
522
- static_assert(std::is_convertible<U&&, value_type>::value,
523
- "optional<T>::value_or: U must be convertible to T");
524
- return static_cast<bool>(*this) ? std::move(**this)
525
- : static_cast<T>(std::forward<U>(v));
526
- }
527
-
528
- private:
529
- // Private accessors for internal storage viewed as reference to T.
530
- constexpr const T& reference() const { return this->data_; }
531
- T& reference() { return this->data_; }
532
-
533
- // T constraint checks. You can't have an optional of nullopt_t, in_place_t
534
- // or a reference.
535
- static_assert(
536
- !std::is_same<nullopt_t, typename std::remove_cv<T>::type>::value,
537
- "optional<nullopt_t> is not allowed.");
538
- static_assert(
539
- !std::is_same<in_place_t, typename std::remove_cv<T>::type>::value,
540
- "optional<in_place_t> is not allowed.");
541
- static_assert(!std::is_reference<T>::value,
542
- "optional<reference> is not allowed.");
543
- };
544
-
545
- // Non-member functions
546
-
547
- // swap()
548
- //
549
- // Performs a swap between two `absl::optional` objects, using standard
550
- // semantics.
551
- template <typename T, typename std::enable_if<
552
- std::is_move_constructible<T>::value &&
553
- type_traits_internal::IsSwappable<T>::value,
554
- bool>::type = false>
555
- void swap(optional<T>& a, optional<T>& b) noexcept(noexcept(a.swap(b))) {
556
- a.swap(b);
557
- }
558
-
559
- // make_optional()
560
- //
561
- // Creates a non-empty `optional<T>` where the type of `T` is deduced. An
562
- // `absl::optional` can also be explicitly instantiated with
563
- // `make_optional<T>(v)`.
564
- //
565
- // Note: `make_optional()` constructions may be declared `constexpr` for
566
- // trivially copyable types `T`. Non-trivial types require copy elision
567
- // support in C++17 for `make_optional` to support `constexpr` on such
568
- // non-trivial types.
569
- //
570
- // Example:
571
- //
572
- // constexpr absl::optional<int> opt = absl::make_optional(1);
573
- // static_assert(opt.value() == 1, "");
574
- template <typename T>
575
- constexpr optional<typename std::decay<T>::type> make_optional(T&& v) {
576
- return optional<typename std::decay<T>::type>(std::forward<T>(v));
577
- }
578
-
579
- template <typename T, typename... Args>
580
- constexpr optional<T> make_optional(Args&&... args) {
581
- return optional<T>(in_place_t(), std::forward<Args>(args)...);
582
- }
583
-
584
- template <typename T, typename U, typename... Args>
585
- constexpr optional<T> make_optional(std::initializer_list<U> il,
586
- Args&&... args) {
587
- return optional<T>(in_place_t(), il, std::forward<Args>(args)...);
588
- }
589
-
590
- // Relational operators [optional.relops]
591
-
592
- // Empty optionals are considered equal to each other and less than non-empty
593
- // optionals. Supports relations between optional<T> and optional<U>, between
594
- // optional<T> and U, and between optional<T> and nullopt.
595
- //
596
- // Note: We're careful to support T having non-bool relationals.
597
-
598
- // Requires: The expression, e.g. "*x == *y" shall be well-formed and its result
599
- // shall be convertible to bool.
600
- // The C++17 (N4606) "Returns:" statements are translated into
601
- // code in an obvious way here, and the original text retained as function docs.
602
- // Returns: If bool(x) != bool(y), false; otherwise if bool(x) == false, true;
603
- // otherwise *x == *y.
604
- template <typename T, typename U>
605
- constexpr auto operator==(const optional<T>& x, const optional<U>& y)
606
- -> decltype(optional_internal::convertible_to_bool(*x == *y)) {
607
- return static_cast<bool>(x) != static_cast<bool>(y)
608
- ? false
609
- : static_cast<bool>(x) == false ? true
610
- : static_cast<bool>(*x == *y);
611
- }
612
-
613
- // Returns: If bool(x) != bool(y), true; otherwise, if bool(x) == false, false;
614
- // otherwise *x != *y.
615
- template <typename T, typename U>
616
- constexpr auto operator!=(const optional<T>& x, const optional<U>& y)
617
- -> decltype(optional_internal::convertible_to_bool(*x != *y)) {
618
- return static_cast<bool>(x) != static_cast<bool>(y)
619
- ? true
620
- : static_cast<bool>(x) == false ? false
621
- : static_cast<bool>(*x != *y);
622
- }
623
- // Returns: If !y, false; otherwise, if !x, true; otherwise *x < *y.
624
- template <typename T, typename U>
625
- constexpr auto operator<(const optional<T>& x, const optional<U>& y)
626
- -> decltype(optional_internal::convertible_to_bool(*x < *y)) {
627
- return !y ? false : !x ? true : static_cast<bool>(*x < *y);
628
- }
629
- // Returns: If !x, false; otherwise, if !y, true; otherwise *x > *y.
630
- template <typename T, typename U>
631
- constexpr auto operator>(const optional<T>& x, const optional<U>& y)
632
- -> decltype(optional_internal::convertible_to_bool(*x > *y)) {
633
- return !x ? false : !y ? true : static_cast<bool>(*x > *y);
634
- }
635
- // Returns: If !x, true; otherwise, if !y, false; otherwise *x <= *y.
636
- template <typename T, typename U>
637
- constexpr auto operator<=(const optional<T>& x, const optional<U>& y)
638
- -> decltype(optional_internal::convertible_to_bool(*x <= *y)) {
639
- return !x ? true : !y ? false : static_cast<bool>(*x <= *y);
640
- }
641
- // Returns: If !y, true; otherwise, if !x, false; otherwise *x >= *y.
642
- template <typename T, typename U>
643
- constexpr auto operator>=(const optional<T>& x, const optional<U>& y)
644
- -> decltype(optional_internal::convertible_to_bool(*x >= *y)) {
645
- return !y ? true : !x ? false : static_cast<bool>(*x >= *y);
646
- }
647
-
648
- // Comparison with nullopt [optional.nullops]
649
- // The C++17 (N4606) "Returns:" statements are used directly here.
650
- template <typename T>
651
- constexpr bool operator==(const optional<T>& x, nullopt_t) noexcept {
652
- return !x;
653
- }
654
- template <typename T>
655
- constexpr bool operator==(nullopt_t, const optional<T>& x) noexcept {
656
- return !x;
657
- }
658
- template <typename T>
659
- constexpr bool operator!=(const optional<T>& x, nullopt_t) noexcept {
660
- return static_cast<bool>(x);
661
- }
662
- template <typename T>
663
- constexpr bool operator!=(nullopt_t, const optional<T>& x) noexcept {
664
- return static_cast<bool>(x);
665
- }
666
- template <typename T>
667
- constexpr bool operator<(const optional<T>&, nullopt_t) noexcept {
668
- return false;
669
- }
670
- template <typename T>
671
- constexpr bool operator<(nullopt_t, const optional<T>& x) noexcept {
672
- return static_cast<bool>(x);
673
- }
674
- template <typename T>
675
- constexpr bool operator<=(const optional<T>& x, nullopt_t) noexcept {
676
- return !x;
677
- }
678
- template <typename T>
679
- constexpr bool operator<=(nullopt_t, const optional<T>&) noexcept {
680
- return true;
681
- }
682
- template <typename T>
683
- constexpr bool operator>(const optional<T>& x, nullopt_t) noexcept {
684
- return static_cast<bool>(x);
685
- }
686
- template <typename T>
687
- constexpr bool operator>(nullopt_t, const optional<T>&) noexcept {
688
- return false;
689
- }
690
- template <typename T>
691
- constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept {
692
- return true;
693
- }
694
- template <typename T>
695
- constexpr bool operator>=(nullopt_t, const optional<T>& x) noexcept {
696
- return !x;
697
- }
698
-
699
- // Comparison with T [optional.comp_with_t]
700
-
701
- // Requires: The expression, e.g. "*x == v" shall be well-formed and its result
702
- // shall be convertible to bool.
703
- // The C++17 (N4606) "Equivalent to:" statements are used directly here.
704
- template <typename T, typename U>
705
- constexpr auto operator==(const optional<T>& x, const U& v)
706
- -> decltype(optional_internal::convertible_to_bool(*x == v)) {
707
- return static_cast<bool>(x) ? static_cast<bool>(*x == v) : false;
708
- }
709
- template <typename T, typename U>
710
- constexpr auto operator==(const U& v, const optional<T>& x)
711
- -> decltype(optional_internal::convertible_to_bool(v == *x)) {
712
- return static_cast<bool>(x) ? static_cast<bool>(v == *x) : false;
713
- }
714
- template <typename T, typename U>
715
- constexpr auto operator!=(const optional<T>& x, const U& v)
716
- -> decltype(optional_internal::convertible_to_bool(*x != v)) {
717
- return static_cast<bool>(x) ? static_cast<bool>(*x != v) : true;
718
- }
719
- template <typename T, typename U>
720
- constexpr auto operator!=(const U& v, const optional<T>& x)
721
- -> decltype(optional_internal::convertible_to_bool(v != *x)) {
722
- return static_cast<bool>(x) ? static_cast<bool>(v != *x) : true;
723
- }
724
- template <typename T, typename U>
725
- constexpr auto operator<(const optional<T>& x, const U& v)
726
- -> decltype(optional_internal::convertible_to_bool(*x < v)) {
727
- return static_cast<bool>(x) ? static_cast<bool>(*x < v) : true;
728
- }
729
- template <typename T, typename U>
730
- constexpr auto operator<(const U& v, const optional<T>& x)
731
- -> decltype(optional_internal::convertible_to_bool(v < *x)) {
732
- return static_cast<bool>(x) ? static_cast<bool>(v < *x) : false;
733
- }
734
- template <typename T, typename U>
735
- constexpr auto operator<=(const optional<T>& x, const U& v)
736
- -> decltype(optional_internal::convertible_to_bool(*x <= v)) {
737
- return static_cast<bool>(x) ? static_cast<bool>(*x <= v) : true;
738
- }
739
- template <typename T, typename U>
740
- constexpr auto operator<=(const U& v, const optional<T>& x)
741
- -> decltype(optional_internal::convertible_to_bool(v <= *x)) {
742
- return static_cast<bool>(x) ? static_cast<bool>(v <= *x) : false;
743
- }
744
- template <typename T, typename U>
745
- constexpr auto operator>(const optional<T>& x, const U& v)
746
- -> decltype(optional_internal::convertible_to_bool(*x > v)) {
747
- return static_cast<bool>(x) ? static_cast<bool>(*x > v) : false;
748
- }
749
- template <typename T, typename U>
750
- constexpr auto operator>(const U& v, const optional<T>& x)
751
- -> decltype(optional_internal::convertible_to_bool(v > *x)) {
752
- return static_cast<bool>(x) ? static_cast<bool>(v > *x) : true;
753
- }
754
- template <typename T, typename U>
755
- constexpr auto operator>=(const optional<T>& x, const U& v)
756
- -> decltype(optional_internal::convertible_to_bool(*x >= v)) {
757
- return static_cast<bool>(x) ? static_cast<bool>(*x >= v) : false;
758
- }
759
- template <typename T, typename U>
760
- constexpr auto operator>=(const U& v, const optional<T>& x)
761
- -> decltype(optional_internal::convertible_to_bool(v >= *x)) {
762
- return static_cast<bool>(x) ? static_cast<bool>(v >= *x) : true;
763
- }
764
-
765
- ABSL_NAMESPACE_END
766
- } // namespace absl
767
-
768
- namespace std {
769
-
770
- // std::hash specialization for absl::optional.
771
- template <typename T>
772
- struct hash<absl::optional<T> >
773
- : absl::optional_internal::optional_hash_base<T> {};
774
-
775
- } // namespace std
776
-
777
- #undef ABSL_MSVC_CONSTEXPR_BUG_IN_UNION_LIKE_CLASS
778
-
779
- #endif // ABSL_USES_STD_OPTIONAL
780
-
781
41
  #endif // ABSL_TYPES_OPTIONAL_H_