summaryrefslogtreecommitdiff
path: root/absl/base/casts.h
Commit message (Collapse)AuthorAge
* Replace absl::type_traits_internal::is_trivially_copyable withGravatar Derek Mauro2023-04-12
| | | | | | | std::is_trivially_copyable PiperOrigin-RevId: 523724345 Change-Id: Id68c79c3bbb253d892bdef4659ac8a926e023d12
* Export of internal Abseil changesGravatar Abseil Team2022-01-31
| | | | | | | | | | | | | | | | | | | | | -- c475e8ac1ea163248415e7d4bdc05e3c47dd8f3d by Derek Mauro <dmauro@google.com>: Replace absl::bit_cast with std::bit_cast in C++20 Remove the deprecated implementation that is less-strict than the standard, and also relies on undefined behavior PiperOrigin-RevId: 425391711 -- dc97c996aed85161f0e490baafd3ed851e8bea9d by Abseil Team <absl-team@google.com>: Add enum example for ABSL_DEPRECATED() PiperOrigin-RevId: 425311634 GitOrigin-RevId: c475e8ac1ea163248415e7d4bdc05e3c47dd8f3d Change-Id: Id8f159b37fe3f3cace6ab7bce08daf9888c44bcf
* Export of internal Abseil changesGravatar Abseil Team2022-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 7f5caec21a1a88db6486b8bc2e5f6d5baba076ed by Derek Mauro <dmauro@google.com>: Tag absl::StatusOr with [[nodiscard]] when it is available [[nodiscard]] provides better diagnostics on classes than the current ABSL_MUST_USE_RESULT, which expands to __attribute__((warn_unused_result)) Ideally we would make ABSL_MUST_USE_RESULT expand to [[nodiscard]], but we would need to fix all code to build with [[nodiscard]] first. PiperOrigin-RevId: 422628161 -- 236be69f0f34ccaa3adc831075613847797e6557 by Jorg Brown <jorg@google.com>: Make sure all of absl/strings compiles even with -Wsign-compare and -Wconversion warnings. PiperOrigin-RevId: 422573904 -- 005669883a8794e6d19dc4bbb4f0e18032e2fbc9 by Chris Kennelly <ckennelly@google.com>: Include sampling stride in hashtable sampling data. This allows us to weight each sample to control for our sampling rate. PiperOrigin-RevId: 421886935 -- 78046ce6b429b9f5b6c97b05e8448a791db93bbe by Abseil Team <absl-team@google.com>: Use __builtin_bit_cast for absl::bit_cast when possible This makes absl::bit_cast match the requirements of the standard when compiler support exists. PiperOrigin-RevId: 421883999 -- f397461f4bbeabd32437df0f2275663aeb51adb2 by Derek Mauro <dmauro@google.com>: Tag absl::Status with [[nodiscard]] when it is available [[nodiscard]] provides better diagnostics on classes than the current ABSL_MUST_USE_RESULT, which expands to __attribute__((warn_unused_result)) Ideally we would make ABSL_MUST_USE_RESULT expand to [[nodiscard]], but we would need to fix all code to build with [[nodiscard]] first. PiperOrigin-RevId: 421825565 GitOrigin-RevId: 7f5caec21a1a88db6486b8bc2e5f6d5baba076ed Change-Id: I760b45b68f6012809c70c2a584e4144a99f98733
* Export of internal Abseil changesGravatar Abseil Team2022-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 0db7f4046f9b59c0f8c3df2f0eb7fd88fc328439 by Abseil Team <absl-team@google.com>: Revise documentation of bit_cast: * Removes inappropriate examples (round-tripping pointers, serialization), for which reinterpret_cast is more appropriate. * Removes mention of "bit representation", which is not an explicit notion in C++. The best we get is "byte representation". * Removes a circular defition of "bitcast" as itself, and instead explains what it does. * Removes the mathism "for some values of", which is probably not totally accessible to a general audience, and in any case needless verbiage. * Fixes comments in the example. * Replaces some colloquialisms with simpler, more direct language. PiperOrigin-RevId: 421791786 -- e04e64df55d93c1b9a09c0483b97cc4d8763260d by Derek Mauro <dmauro@google.com>: Update Docker image to use GCC 11.2, Clang 14 (prerelease), CMake 3.22.1, and Bazel 4.2.2 PiperOrigin-RevId: 421658559 -- d002bb3dc5cd1fc5b4cbd79a450efc894caa567c by Chris Kennelly <ckennelly@google.com>: Add a small microbenchmark for absl::bit_width. PiperOrigin-RevId: 421604852 -- 131b057d1b76ecd7170421b48d661bb958ff676b by Evan Brown <ezb@google.com>: Adds a disabled test for EBO in nested `CompressedTuple`s. PiperOrigin-RevId: 421413134 -- e34c7876d3a1212d90c73c030ccae6169b682d43 by Jorg Brown <jorg@google.com>: Show users a better error message if they pass a pointer to absl::Uniform. PiperOrigin-RevId: 421090472 GitOrigin-RevId: 0db7f4046f9b59c0f8c3df2f0eb7fd88fc328439 Change-Id: I5a004e8d17e974fa4897a09d1466ae8fc65dfdbb
* Export of internal Abseil changesGravatar Abseil Team2020-08-14
| | | | | | | | | | | -- daabc2a08b55696424add36e8fd6ed0ab397dadc by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 326713082 GitOrigin-RevId: daabc2a08b55696424add36e8fd6ed0ab397dadc Change-Id: Ibe91394988bc3bcfaae7ac16bdc1e9b5dfd16588
* Export of internal Abseil changesGravatar Abseil Team2019-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- b842b7fd9b1289be31f0b7ee8e62e48e550747cf by Greg Falcon <gfalcon@google.com>: Change the Cord str_format formatter to use iteration instead of CordReader. When Cord is publicly released, CordReader is not going with it. PiperOrigin-RevId: 284780736 -- 28e76c08ea7185a7ff9f4e0e02ae565fbbf7980f by Greg Falcon <gfalcon@google.com>: Implementation detail change. Introduce ABSL_NAMESPACE_BEGIN and _END annotation macros which indicate the beginning and end of a `namespace absl` scope. Currently these do nothing, but they will be used to inject an inline namespace for LTS builds (to avoid symbol collisions against other Abseil versions). These macros should not be used by end users, because end users should never write `namespace absl {` in their own code. This CL applies these annotations to all code under //absl/base/. The rest of Abseil will be annotated in this way in follow-up CLs. PiperOrigin-RevId: 284776410 -- e1711dc6d696dcca50d4e7d4b4d8f3076575b7ec by Abseil Team <absl-team@google.com>: --help changed to report long flags. PiperOrigin-RevId: 284757720 -- 78f66a68f428bbbd19d8d60e1125f43ba765fd35 by Tom Manshreck <shreck@google.com>: Update comment on + or - in SimpleAToi() PiperOrigin-RevId: 284231843 GitOrigin-RevId: b842b7fd9b1289be31f0b7ee8e62e48e550747cf Change-Id: I3046b31391bd11c8bc4abab7785a863c377cd757
* Export of internal Abseil changes.Gravatar Abseil Team2019-05-17
| | | | | | | | | | | | | | | | | | | | -- cae9f0c87632d690ec3f471e181be247fe4fb025 by Abseil Team <absl-team@google.com>: Run IWYU on some headers. PiperOrigin-RevId: 248749194 -- f57dcac97cacbe31769a8646020a99b6686987dc by Samuel Benzaquen <sbenza@google.com>: Accept vector<bool>::reference in StrFormat and friends. The proxy types might overload `operator&`. Use std::addressof instead. PiperOrigin-RevId: 248619661 GitOrigin-RevId: cae9f0c87632d690ec3f471e181be247fe4fb025 Change-Id: Iacf5d46a59d1d5f1fa1fd4a1e0d0de8c6cbedb3e
* Export of internal Abseil changes.Gravatar Abseil Team2019-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 5755b40f6025f3ca126070fc68adb8fde9a7f01b by Abseil Team <absl-team@google.com>: Fix -Wextra-semi error. PiperOrigin-RevId: 243215850 -- 3b6b6e18df9fbd233943cae460f0063f4efaa7c7 by Eric Fiselier <ericwf@google.com>: Internal Change. PiperOrigin-RevId: 243152671 -- 82eef03f246009c806c25607c5682547cb4ad21e by Abseil Team <absl-team@google.com>: Internal change. PiperOrigin-RevId: 243151861 -- c14e6340fca7070634e0ecfdf97833d930dd0e5d by Samuel Benzaquen <sbenza@google.com>: Internal change PiperOrigin-RevId: 243123590 -- 9abb7a6b22457c0aa72d72b3b9392efd226d302a by Andy Getzendanner <durandal@google.com>: Implement operator<<(std::ostream &, absl::LogSeverity) so that absl::LogSeverity values can be streamed. PiperOrigin-RevId: 243117646 GitOrigin-RevId: 5755b40f6025f3ca126070fc68adb8fde9a7f01b Change-Id: I7ea607d8a4e803ad15a3090139271f58ad4173a3
* Changed HTTP URLs to HTTPS where possible (#270)Gravatar nik72732019-03-08
|
* Export of internal Abseil changes.Gravatar Abseil Team2018-10-18
| | | | | | | | | | | | -- f6241e6923d4d1525d3ec54bc5b85178b18612e9 by Derek Mauro <dmauro@google.com>: Make implicit_cast constexpr. GitHub #191 PiperOrigin-RevId: 217726953 GitOrigin-RevId: f6241e6923d4d1525d3ec54bc5b85178b18612e9 Change-Id: I46e4d92cbd54a38bfe5faeb939cf19d871d8b697
* Export of internal Abseil changes.Gravatar Abseil Team2018-07-03
| | | | | | | | | | | | | | | | | | -- 71756e7176d15d52a4ee66cc25c088aedbca78f4 by Abseil Team <absl-team@google.com>: internal change PiperOrigin-RevId: 203131836 -- 2e80b965b590fd6459f45413215690980eb50960 by Matt Calabrese <calabrese@google.com>: Tighten type requirements for use of absl::bit_cast. Ideally, the constraints should depend on std::is_trivally_copyable, but a combination of supported configurations and lack of intrinsic support for bit_cast makes this not currently feasible. In a future change we should introduce more proper preprocessor branching and workarounds to better emulate the trait. PiperOrigin-RevId: 202950382 GitOrigin-RevId: 71756e7176d15d52a4ee66cc25c088aedbca78f4 Change-Id: If58840d1e4d801817be85cbf99a475c31fa94fe0
* Fix some typos.Gravatar Bruce Mitchener2018-04-20
|
* - ed0ba496fe01eb8edfa86beade8a37768e7c12ef Updates the API for Exception ↵Gravatar Abseil Team2018-04-19
| | | | | | | | | | | | | | | | | | Safety testing to use build... by Abseil Team <absl-team@google.com> - c4b7a4e517c9404932c45f2f9f92eb7dc694e45d Internal change by Abseil Team <absl-team@google.com> - 76c78ed9385f65d881511645446e0bb8ababf6ec Add missing ABSL_PREDICT_FALSE to one of FixedArray::at()... by Abseil Team <absl-team@google.com> - 1204fb1c46f007dd9dfb7d9abf3e96c58835d193 Internal change. by Greg Falcon <gfalcon@google.com> - f1f47c98a026bc5e425ae83ff4a2eb391bbd3d9b Add internal-only functionality to examine the stack, to ... by Derek Mauro <dmauro@google.com> - 30d63097cd268d912f917526f6511005580465c4 fix typo by Abseil Team <absl-team@google.com> - 942d7efa6cf54cd248ca57dcaf3c245188b52a76 Remove unnecessary semicolons from comment examples. by Abseil Team <absl-team@google.com> - 7db0669cf23a06d934d3ed8c76aee4e4e23b7e04 Remove malloc_hook and malloc_extension from our internal... by Greg Falcon <gfalcon@google.com> - 0190f1063d101b1ded355019df2e1d325931f6c7 Make the maximum length of a string view equal difference... by Abseil Team <absl-team@google.com> - c8ae37cbce29449b02115a0ebd435ddc3d7ab062 Add namespace qualification. by Shaindel Schwartz <shaindel@google.com> - ff70afe2e6e3dd39f51ce9829e3e1f18231bf4d7 Fix internal/direct_mmap.h for non-linux builds. by Greg Falcon <gfalcon@google.com> GitOrigin-RevId: ed0ba496fe01eb8edfa86beade8a37768e7c12ef Change-Id: I7595ee3480d1d6724fd3797c15ba9d9be0d17e62
* Changes imported from Abseil "staging" branch:Gravatar Abseil Team2017-09-29
| | | | | | | | | | | | - b76f5d50e1cb55050ef6004d6097dfdf0a806ff5 Fix ABSL_HAVE_THREAD_LOCAL for iOS < 8.0. by Matt Armstrong <marmstrong@google.com> - 1dc71788a3f4ef601e03cbea59e36901479cde35 Add missing #include <intrin.h> to use __nop() on MSVC. by Derek Mauro <dmauro@google.com> - f63ca6c7e87a7961912995b518b93af41b04bfa1 Fix typo (implict -> implicit) by Abseil Team <absl-team@google.com> - 8096006dc52368f166ccd22e25fcee334e142508 Fix a typo. by Abseil Team <absl-team@google.com> - c673a4a59790329fab33536caed6733dc03ec2a1 Add missing ":" in TODO. by Abseil Team <absl-team@google.com> - 8125d214356501af0f3a8b3bb577eed083f0493f Fix comment nit. by Abseil Team <absl-team@google.com> GitOrigin-RevId: b76f5d50e1cb55050ef6004d6097dfdf0a806ff5 Change-Id: I0168eb0c92b20ece2fe5ee54573c7720d00fd0b3
* Initial CommitGravatar misterg2017-09-19