Namespaces
-
namespace ascii_internal -
namespace base_internal -
namespace big_endian -
namespace compare_internal -
namespace container_algorithm_internal -
namespace container_internal -
namespace cord_internal -
namespace crc_internal -
namespace debugging_internal -
namespace functional_internal -
namespace hash_internal -
namespace inlined_vector_internal -
namespace int128_internal -
namespace internal_any_invocable -
namespace internal_statusor -
namespace little_endian -
namespace log_internal -
namespace macros_internal -
namespace memory_internal -
namespace numbers_internal -
namespace numeric_internal -
namespace profiling_internal -
namespace raw_log_internal -
namespace span_internal -
namespace status_internal -
namespace str_format_internal -
namespace strings_internal -
namespace swap_internal -
namespace synchronization_internal -
namespace time_internal -
namespace type_traits_internal -
namespace variant_internal
Enumerations
enum class LengthMod : std::uint8_t
| Name | Value |
|---|---|
| h | 0 |
| hh | 1 |
| l | 2 |
| ll | 3 |
| L | 4 |
| j | 5 |
| z | 6 |
| t | 7 |
| q | 8 |
| none | 9 |
Defined at line 35 of file ../../third_party/abseil-cpp/src/absl/strings/internal/str_format/extension.h
enum ConstInitType
| Name | Value |
|---|---|
| kConstInit | 0 |
Defined at line 69 of file ../../third_party/abseil-cpp/src/absl/base/const_init.h
enum class LogSeverity : int
| Name | Value |
|---|---|
| kInfo | 0 |
| kWarning | 1 |
| kError | 2 |
| kFatal | 3 |
absl::LogSeverity
Four severity levels are defined. Logging APIs should terminate the program
when a message is logged at severity `kFatal`; the other levels have no
special semantics.
Values other than the four defined levels (e.g. produced by `static_cast`)
are valid, but their semantics when passed to a function, macro, or flag
depend on the function, macro, or flag. The usual behavior is to normalize
such values to a defined severity level, however in some cases values other
than the defined levels are useful for comparison.
Example:
// Effectively disables all logging:
SetMinLogLevel(static_cast
<absl
::LogSeverity>(100));
Abseil flags may be defined with type `LogSeverity`. Dependency layering
constraints require that the `AbslParseFlag()` overload be declared and
defined in the flags library itself rather than here. The `AbslUnparseFlag()`
overload is defined there as well for consistency.
absl::LogSeverity Flag String Representation
An `absl::LogSeverity` has a string representation used for parsing
command-line flags based on the enumerator name (e.g. `kFatal`) or
its unprefixed name (without the `k`) in any case-insensitive form. (E.g.
"FATAL", "fatal" or "Fatal" are all valid.) Unparsing such flags produces an
unprefixed string representation in all caps (e.g. "FATAL") or an integer.
Additionally, the parser accepts arbitrary integers (as if the type were
`int`).
Examples:
--my_log_level=kInfo
--my_log_level=INFO
--my_log_level=info
--my_log_level=0
`DFATAL` and `kLogDebugFatal` are similarly accepted.
Unparsing a flag produces the same result as `absl::LogSeverityName()` for
the standard levels and a base-ten integer otherwise.
Defined at line 71 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
enum class StatusCode : int
| Name | Value | Comments |
|---|---|---|
| kOk | 0 |
StatusCode::kOk
kOK (gRPC code "OK") does not indicate an error; this value is returned on |
| kCancelled | 1 |
StatusCode::kCancelled
kCancelled (gRPC code "CANCELLED") indicates the operation was cancelled, |
| kUnknown | 2 |
StatusCode::kUnknown
kUnknown (gRPC code "UNKNOWN") indicates an unknown error occurred. In |
| kInvalidArgument | 3 |
StatusCode::kInvalidArgument
kInvalidArgument (gRPC code "INVALID_ARGUMENT") indicates the caller |
| kDeadlineExceeded | 4 |
StatusCode::kDeadlineExceeded
kDeadlineExceeded (gRPC code "DEADLINE_EXCEEDED") indicates a deadline |
| kNotFound | 5 |
StatusCode::kNotFound
kNotFound (gRPC code "NOT_FOUND") indicates some requested entity (such as
`kNotFound` is useful if a request should be denied for an entire class of |
| kAlreadyExists | 6 |
StatusCode::kAlreadyExists
kAlreadyExists (gRPC code "ALREADY_EXISTS") indicates that the entity a |
| kPermissionDenied | 7 |
StatusCode::kPermissionDenied
kPermissionDenied (gRPC code "PERMISSION_DENIED") indicates that the caller
`kPermissionDenied` must not be used for rejections caused by exhausting |
| kResourceExhausted | 8 |
StatusCode::kResourceExhausted
kResourceExhausted (gRPC code "RESOURCE_EXHAUSTED") indicates some resource |
| kFailedPrecondition | 9 |
StatusCode::kFailedPrecondition
kFailedPrecondition (gRPC code "FAILED_PRECONDITION") indicates that the
Some guidelines that may help a service implementer in deciding between
(a) Use `kUnavailable` if the client can retry just the failing call. |
| kAborted | 10 |
StatusCode::kAborted
kAborted (gRPC code "ABORTED") indicates the operation was aborted,
See the guidelines above for deciding between `kFailedPrecondition`, |
| kOutOfRange | 11 |
StatusCode::kOutOfRange
kOutOfRange (gRPC code "OUT_OF_RANGE") indicates the operation was
Unlike `kInvalidArgument`, this error indicates a problem that may
There is a fair bit of overlap between `kFailedPrecondition` and |
| kUnimplemented | 12 |
StatusCode::kUnimplemented
kUnimplemented (gRPC code "UNIMPLEMENTED") indicates the operation is not |
| kInternal | 13 |
StatusCode::kInternal
kInternal (gRPC code "INTERNAL") indicates an internal error has occurred |
| kUnavailable | 14 |
StatusCode::kUnavailable
kUnavailable (gRPC code "UNAVAILABLE") indicates the service is currently
See the guidelines above for deciding between `kFailedPrecondition`, |
| kDataLoss | 15 |
StatusCode::kDataLoss
kDataLoss (gRPC code "DATA_LOSS") indicates that unrecoverable data loss or |
| kUnauthenticated | 16 |
StatusCode::kUnauthenticated
kUnauthenticated (gRPC code "UNAUTHENTICATED") indicates that the request |
| kDoNotUseReservedForFutureExpansionUseDefaultInSwitchInstead_ | 20 |
StatusCode::DoNotUseReservedForFutureExpansionUseDefaultInSwitchInstead_
NOTE: this error code entry should not be used and you should not rely on
The purpose of this enumerated value is to force people who handle status |
absl::StatusCode
An `absl::StatusCode` is an enumerated type indicating either no error ("OK")
or an error condition. In most cases, an `absl::Status` indicates a
recoverable error, and the purpose of signalling an error is to indicate what
action to take in response to that error. These error codes map to the proto
RPC error codes indicated in https://cloud.google.com/apis/design/errors.
The errors listed below are the canonical errors associated with
`absl::Status` and are used throughout the codebase. As a result, these
error codes are somewhat generic.
In general, try to return the most specific error that applies if more than
one error may pertain. For example, prefer `kOutOfRange` over
`kFailedPrecondition` if both codes apply. Similarly prefer `kNotFound` or
`kAlreadyExists` over `kFailedPrecondition`.
Because these errors may cross RPC boundaries, these codes are tied to the
`google.rpc.Code` definitions within
https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
The string value of these RPC codes is denoted within each enum below.
If your error handling code requires more context, you can attach payloads
to your status. See `absl::Status::SetPayload()` and
`absl::Status::GetPayload()` below.
Defined at line 99 of file ../../third_party/abseil-cpp/src/absl/status/status.h
enum class CordMemoryAccounting
| Name | Value | Comments |
|---|---|---|
| kTotal | 0 |
Counts the *approximate* number of bytes held in full or in part by this |
| kTotalMorePrecise | 1 |
Counts the *approximate* number of bytes held in full or in part by this
For example:
The `kTotalMorePrecise` number is more expensive to compute as it requires |
| kFairShare | 2 |
Counts the *approximate* number of bytes held in full or in part by this |
Cord memory accounting modes
Defined at line 110 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
enum class LogSeverityAtLeast : int
| Name | Value |
|---|---|
| kInfo | static_cast<int>(absl::LogSeverity::kInfo) |
| kWarning | static_cast<int>(absl::LogSeverity::kWarning) |
| kError | static_cast<int>(absl::LogSeverity::kError) |
| kFatal | static_cast<int>(absl::LogSeverity::kFatal) |
| kInfinity | 1000 |
Enums representing a lower bound for LogSeverity. APIs that only operate on
messages of at least a certain level (for example, `SetMinLogLevel()`) use
this type to specify that level. absl::LogSeverityAtLeast::kInfinity is
a level above all threshold levels and therefore no log message will
ever meet this threshold.
Defined at line 136 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
enum PadSpec : uint8_t
| Name | Value |
|---|---|
| kNoPad | 1 |
| kZeroPad2 | 2 |
| kZeroPad3 | 3 |
| kZeroPad4 | 4 |
| kZeroPad5 | 5 |
| kZeroPad6 | 6 |
| kZeroPad7 | 7 |
| kZeroPad8 | 8 |
| kZeroPad9 | 9 |
| kZeroPad10 | 10 |
| kZeroPad11 | 11 |
| kZeroPad12 | 12 |
| kZeroPad13 | 13 |
| kZeroPad14 | 14 |
| kZeroPad15 | 15 |
| kZeroPad16 | 16 |
| kZeroPad17 | 17 |
| kZeroPad18 | 18 |
| kZeroPad19 | 19 |
| kZeroPad20 | 20 |
| kSpacePad2 | kZeroPad2 + 64 |
| kSpacePad3 | 67 |
| kSpacePad4 | 68 |
| kSpacePad5 | 69 |
| kSpacePad6 | 70 |
| kSpacePad7 | 71 |
| kSpacePad8 | 72 |
| kSpacePad9 | 73 |
| kSpacePad10 | 74 |
| kSpacePad11 | 75 |
| kSpacePad12 | 76 |
| kSpacePad13 | 77 |
| kSpacePad14 | 78 |
| kSpacePad15 | 79 |
| kSpacePad16 | 80 |
| kSpacePad17 | 81 |
| kSpacePad18 | 82 |
| kSpacePad19 | 83 |
| kSpacePad20 | 84 |
Enum that specifies the number of significant digits to return in a `Hex` or
`Dec` conversion and fill character to use. A `kZeroPad2` value, for example,
would produce hexadecimal strings such as "0a","0f" and a 'kSpacePad5' value
would produce hexadecimal strings such as " a"," f".
Defined at line 138 of file ../../third_party/abseil-cpp/src/absl/strings/str_cat.h
enum class LogSeverityAtMost : int
| Name | Value |
|---|---|
| kNegativeInfinity | -1000 |
| kInfo | static_cast<int>(absl::LogSeverity::kInfo) |
| kWarning | static_cast<int>(absl::LogSeverity::kWarning) |
| kError | static_cast<int>(absl::LogSeverity::kError) |
| kFatal | static_cast<int>(absl::LogSeverity::kFatal) |
Enums representing an upper bound for LogSeverity. APIs that only operate on
messages of at most a certain level (for example, buffer all messages at or
below a certain level) use this type to specify that level.
absl::LogSeverityAtMost::kNegativeInfinity is a level below all threshold
levels and therefore will exclude all log messages.
Defined at line 151 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
enum class FormatConversionChar : uint8_t
| Name | Value | Comments |
|---|---|---|
| c | 0 |
text |
| s | 1 |
text |
| d | 2 |
int |
| i | 3 |
int |
| o | 4 |
int |
| u | 5 |
int |
| x | 6 |
int |
| X | 7 |
int |
| f | 8 |
float |
| F | 9 |
float |
| e | 10 |
float |
| E | 11 |
float |
| g | 12 |
float |
| G | 13 |
float |
| a | 14 |
float |
| A | 15 |
float |
| n | 16 |
misc |
| p | 17 |
misc |
| v | 18 |
misc |
FormatConversionChar
Specifies the formatting character provided in the format string
passed to `StrFormat()`.
Defined at line 695 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
enum class FormatConversionCharSet : uint64_t
| Name | Value | Comments |
|---|---|---|
| c | str_format_internal::FormatConversionCharToConvInt('c') |
text |
| s | str_format_internal::FormatConversionCharToConvInt('s') |
text |
| d | str_format_internal::FormatConversionCharToConvInt('d') |
integer |
| i | str_format_internal::FormatConversionCharToConvInt('i') |
integer |
| o | str_format_internal::FormatConversionCharToConvInt('o') |
integer |
| u | str_format_internal::FormatConversionCharToConvInt('u') |
integer |
| x | str_format_internal::FormatConversionCharToConvInt('x') |
integer |
| X | str_format_internal::FormatConversionCharToConvInt('X') |
integer |
| f | str_format_internal::FormatConversionCharToConvInt('f') |
Float |
| F | str_format_internal::FormatConversionCharToConvInt('F') |
Float |
| e | str_format_internal::FormatConversionCharToConvInt('e') |
Float |
| E | str_format_internal::FormatConversionCharToConvInt('E') |
Float |
| g | str_format_internal::FormatConversionCharToConvInt('g') |
Float |
| G | str_format_internal::FormatConversionCharToConvInt('G') |
Float |
| a | str_format_internal::FormatConversionCharToConvInt('a') |
Float |
| A | str_format_internal::FormatConversionCharToConvInt('A') |
Float |
| n | str_format_internal::FormatConversionCharToConvInt('n') |
misc |
| p | str_format_internal::FormatConversionCharToConvInt('p') |
misc |
| v | str_format_internal::FormatConversionCharToConvInt('v') |
misc |
| kStar | static_cast<uint64_t>( absl::str_format_internal::FormatConversionCharSetInternal::kStar) |
Used for width/precision '*' specification. |
| kIntegral | d | i | u | o | x | X |
Some predefined values: |
| kFloating | a | e | f | g | A | E | F | G |
Some predefined values: |
| kNumeric | kIntegral | kFloating |
Some predefined values: |
| kString | s |
Some predefined values: |
| kPointer | p |
Some predefined values: |
FormatConversionCharSet
Specifies the _accepted_ conversion types as a template parameter to
FormatConvertResult for custom implementations of `AbslFormatConvert`.
Note the helper predefined alias definitions (kIntegral, etc.) below.
Defined at line 796 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
enum class StatusToStringMode : int
| Name | Value | Comments |
|---|---|---|
| kWithNoExtraData | 0 |
ToString will not contain any extra data (such as payloads). It will only |
| kWithPayload | 1 << 0 |
ToString will contain the payloads. |
| kWithEverything | ~kWithNoExtraData |
ToString will include all the extra data this Status has. |
| kDefault | kWithPayload |
Default mode used by ToString. Its exact value might change in the future. |
absl::StatusToStringMode
An `absl::StatusToStringMode` is an enumerated type indicating how
`absl::Status::ToString()` should construct the output string for a non-ok
status.
Defined at line 302 of file ../../third_party/abseil-cpp/src/absl/status/status.h
enum class OnDeadlockCycle
| Name | Value | Comments |
|---|---|---|
| kIgnore | 0 |
Neither report on nor attempt to track cycles in lock ordering |
| kReport | 1 |
Report lock cycles to stderr when detected |
| kAbort | 2 |
Report lock cycles to stderr when detected, then abort |
Possible modes of operation for the deadlock detector in debug mode.
Defined at line 1294 of file ../../third_party/abseil-cpp/src/absl/synchronization/mutex.h
Records
-
class AllowEmpty -
class AlphaNum -
class AnyInvocable -
class BadStatusOrAccess -
class ByAnyChar -
class ByAsciiWhitespace -
class ByChar -
class ByLength -
class ByString -
class CondVar -
class Condition -
class Cord -
class CordBuffer -
class CordBufferTestPeer -
class CordTestPeer -
class CrcCord -
class Dec -
class Duration -
class FixedArray -
class FormatConversionSpec -
class FormatConvertResult -
class FormatCountCapture -
class FormatRawSink -
class FormatSink -
class FunctionRef -
class FunctionRef<R(Args...)> -
class HasAbslStringify -
class HasAbslStringify<T, std::enable_if_t<std::is_void<decltype(AbslStringify( std::declval<strings_internal::UnimplementedSink&>(), std::declval<const T&>()))>::value>> -
class HasOstreamOperator -
class HasOstreamOperator<T, std::enable_if_t<std::is_same< std::ostream&, decltype(std::declval<std::ostream&>() << std::declval<const T&>())>::value>> -
class HashState -
class Hex -
class InlinedVector -
class LogEntry -
class LogSink -
class MuHowS -
class Mutex -
class MutexLock -
class MutexLockMaybe -
class NoDestructor -
class ReaderMutexLock -
class ReleasableMutexLock -
class SkipEmpty -
class SkipWhitespace -
class Span -
class Status -
class StatusOr -
class SynchLocksHeld -
class SynchWaitParams -
class Time -
class TimeConversion -
class TimeZone -
class UntypedFormatSpec -
class WriterMutexLock -
class allocator_is_nothrow -
class btree_map -
class btree_multimap -
class crc32c_t -
class default_allocator_is_nothrow -
class flat_hash_map -
class int128 -
class is_trivially_relocatable -
class nontype_t -
class once_flag -
class uint128
Functions
-
string_view ClippedSubstr (string_views,size_tpos,size_tn)ClippedSubstr()
Like `s.substr(pos, n)`, but clips `pos` to an upper bound of `s.size()`.
Provided because std::string_view::substr throws if `pos > size()`
Defined at line 42 of file ../../third_party/abseil-cpp/src/absl/strings/string_view.h
-
absl::Time Now ()Now()
Returns the current time, expressed as an `absl::Time` absolute time value.
-
int64_t GetCurrentTimeNanos ()GetCurrentTimeNanos()
Returns the current time, expressed as a count of nanoseconds since the Unix
Epoch (https://en.wikipedia.org/wiki/Unix_time). Prefer `absl::Now()` instead
for all but the most performance-sensitive cases (i.e. when you are calling
this function hundreds of thousands of times per second).
-
bool StrContains (absl::string_view haystack, absl::string_view needle)StrContains()
Returns whether a given string `haystack` contains the substring `needle`.
Defined at line 46 of file ../../third_party/abseil-cpp/src/absl/strings/match.h
-
bool ConsumePrefix (absl::string_view * _Nonnull str, absl::string_view expected)ConsumePrefix()
Strips the `expected` prefix, if found, from the start of `str`.
If the operation succeeded, `true` is returned. If not, `false`
is returned and `str` is not modified.
Example:
absl::string_view input("abc");
EXPECT_TRUE(absl::ConsumePrefix(
&input
, "a"));
EXPECT_EQ(input, "bc");
Defined at line 48 of file ../../third_party/abseil-cpp/src/absl/strings/strip.h
-
bool StrContains (absl::string_view haystack, char needle)Defined at line 51 of file ../../third_party/abseil-cpp/src/absl/strings/match.h
-
string_view NullSafeStringView (const char * _Nullable p)NullSafeStringView()
Creates an `absl::string_view` from a pointer `p` even if it's null-valued.
This function should be used where an `absl::string_view` can be created from
a possibly-null pointer.
Defined at line 53 of file ../../third_party/abseil-cpp/src/absl/strings/string_view.h
-
template <typename InputIterator, typename EqualityComparable>bool linear_search (InputIteratorfirst,InputIteratorlast,const EqualityComparable &value)linear_search()
Performs a linear search for `value` using the iterator `first` up to
but not including `last`, returning true if [`first`, `last`) contains an
element equal to `value`.
A linear search is of O(n) complexity which is guaranteed to make at most
n = (`last` - `first`) comparisons. A linear search over short containers
may be faster than a binary search, even when the container is sorted.
Defined at line 56 of file ../../third_party/abseil-cpp/src/absl/algorithm/algorithm.h
-
bool StartsWith (absl::string_view text, absl::string_view prefix)StartsWith()
Returns whether a given string `text` begins with `prefix`.
Defined at line 58 of file ../../third_party/abseil-cpp/src/absl/strings/match.h
-
bool ConsumeSuffix (absl::string_view * _Nonnull str, absl::string_view expected)ConsumeSuffix()
Strips the `expected` suffix, if found, from the end of `str`.
If the operation succeeded, `true` is returned. If not, `false`
is returned and `str` is not modified.
Example:
absl::string_view input("abcdef");
EXPECT_TRUE(absl::ConsumeSuffix(
&input
, "def"));
EXPECT_EQ(input, "abc");
Defined at line 65 of file ../../third_party/abseil-cpp/src/absl/strings/strip.h
-
void SleepFor (absl::Duration duration)SleepFor()
Sleeps for the specified duration, expressed as an `absl::Duration`.
Notes:
* Signal interruptions will not reduce the sleep duration.
* Returns immediately when passed a nonpositive duration.
Defined at line 74 of file ../../third_party/abseil-cpp/src/absl/time/clock.h
-
template <class F>FunctionRef<F> <deduction guide for FunctionRef> (F * ) -
template <auto Func>FunctionRef<std::remove_pointer_t<decltype(Func)>> <deduction guide for FunctionRef> (nontype_t<Func> ) -
template <class M,class T,M T::* Func,class U>FunctionRef<std::enable_if_t<std::is_member_pointer_v<M T::*>, M>> <deduction guide for FunctionRef> (nontype_t<Func> , U && ) -
template <class M,class T,M T::* Func,class U>FunctionRef<std::enable_if_t<std::is_object_v<M>, std::invoke_result_t<decltype(Func), U &> ()>> <deduction guide for FunctionRef> (nontype_t<Func> , U && ) -
template <class R,class T,class... Args,R (*Func)(T, Args...),class U>FunctionRef<R (Args...)> <deduction guide for FunctionRef> (nontype_t<Func> , U && ) -
template <typename H,typename TheT,size_t TheN,typename TheA>H AbslHashValue (H h, const absl::InlinedVector<TheT, TheN, TheA> & a) -
template <typename To, typename Variant>To ConvertVariantTo (Variant && variant)ConvertVariantTo()
Helper functions to convert an `absl::variant` to a variant of another set of
types, provided that the alternative type of the new variant type can be
converted from any type in the source variant.
Example:
absl::variant
<name1
, name2, float> InternalReq(const Req
&
);
// name1 and name2 are convertible to name
absl::variant
<name
, float> ExternalReq(const Req
&
req) {
return absl::ConvertVariantTo
<absl
::variant
<name
, float>>(
InternalReq(req));
}
Defined at line 74 of file ../../third_party/abseil-cpp/src/absl/types/variant.h
-
bool EndsWith (absl::string_view text, absl::string_view suffix)EndsWith()
Returns whether a given string `text` ends with `suffix`.
Defined at line 74 of file ../../third_party/abseil-cpp/src/absl/strings/match.h
-
std::array<absl::LogSeverity, 4> LogSeverities ()LogSeverities()
Returns an iterable of all standard `absl::LogSeverity` values, ordered from
least to most severe.
Defined at line 82 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
strings_internal::AlphaNumFormatterImpl AlphaNumFormatter ()AlphaNumFormatter()
Default formatter used if none is specified. Uses `absl::AlphaNum` to convert
numeric arguments to strings.
Defined at line 96 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
void RegisterMutexProfiler (void (* _Nonnull)(int64_t) fn)Register hooks for profiling support.
The function pointer registered here will be called whenever a mutex is
contended. The callback is given the cycles for which waiting happened (as
measured by //absl/base/internal/cycleclock.h, and which may not
be real "cycle" counts.)
There is no ordering guarantee between when the hook is registered and when
callbacks will begin. Only a single profiler can be installed in a running
binary; if this function is called a second time with a different function
pointer, the value is ignored (and will cause an assertion failure in debug
mode.)
-
void RegisterMutexTracer (void (* _Nonnull)(const char * _Nonnull, const void * _Nonnull, int64_t) fn)Register a hook for Mutex tracing.
The function pointer registered here will be called whenever a mutex is
contended. The callback is given an opaque handle to the contended mutex,
an event name, and the number of wait cycles (as measured by
//absl/base/internal/cycleclock.h, and which may not be real
"cycle" counts.)
The only event name currently sent is "slow release".
This has the same ordering and single-use limitations as
RegisterMutexProfiler() above.
-
void RegisterCondVarTracer (void (* _Nonnull)(const char * _Nonnull, const void * _Nonnull) fn)Register a hook for CondVar tracing.
The function pointer registered here will be called here on various CondVar
events. The callback is given an opaque handle to the CondVar object and
a string identifying the event. This is thread-safe, but only a single
tracer can be registered.
Events that can be sent are "Wait", "Unwait", "Signal wakeup", and
"SignalAll wakeup".
This has the same ordering and single-use limitations as
RegisterMutexProfiler() above.
-
void EnableMutexInvariantDebugging (bool enabled)EnableMutexInvariantDebugging()
Enable or disable global support for Mutex invariant debugging. If enabled,
then invariant predicates can be registered per-Mutex for debug checking.
See Mutex::EnableInvariantDebugging().
-
void SetMutexDeadlockDetectionMode (OnDeadlockCycle mode)SetMutexDeadlockDetectionMode()
Enable or disable global support for detection of potential deadlocks
due to Mutex lock ordering inversions. When set to 'kIgnore', tracking of
lock ordering is disabled. Otherwise, in debug builds, a lock ordering graph
will be maintained internally, and detected cycles will be reported in
the manner chosen here.
-
TimeConversion ConvertDateTime (int64_tyear,intmon,intday,inthour,intmin,intsec,TimeZonetz)ConvertDateTime()
Legacy version of `absl::TimeZone::At(absl::CivilSecond)` that takes
the civil time as six, separate values (YMDHMS).
The input month, day, hour, minute, and second values can be outside
of their valid ranges, in which case they will be "normalized" during
the conversion.
Example:
// "October 32" normalizes to "November 1".
absl::TimeConversion tc =
absl::ConvertDateTime(2013, 10, 32, 8, 30, 0, lax);
// tc.kind == TimeConversion::UNIQUE
&
&
tc.normalized == true
// absl::ToCivilDay(tc.pre, tz).month() == 11
// absl::ToCivilDay(tc.pre, tz).day() == 1
Deprecated. Use `absl::TimeZone::At(CivilSecond)`.
-
uint64_t gbswap_64 (uint64_t x)Defined at line 33 of file ../../third_party/abseil-cpp/src/absl/base/internal/endian.h
-
uint32_t gbswap_32 (uint32_t x)Defined at line 48 of file ../../third_party/abseil-cpp/src/absl/base/internal/endian.h
-
uint16_t gbswap_16 (uint16_t x)Defined at line 59 of file ../../third_party/abseil-cpp/src/absl/base/internal/endian.h
-
uint16_t ghtons (uint16_t x)Portable definitions for htonl (host-to-network) and friends on little-endian
architectures.
Defined at line 72 of file ../../third_party/abseil-cpp/src/absl/base/internal/endian.h
-
template <typename T>std::unique_ptr<T> WrapUnique (T * ptr)-----------------------------------------------------------------------------
Function Template: WrapUnique()
-----------------------------------------------------------------------------
Adopts ownership from a raw pointer and transfers it to the returned
`std::unique_ptr`, whose type is deduced. Because of this deduction, *do not*
specify the template type `T` when calling `WrapUnique`.
Example:
X* NewX(int, int);
auto x = WrapUnique(NewX(1, 2)); // 'x' is std::unique_ptr
<X
>.
Do not call WrapUnique with an explicit type, as in
`WrapUnique
<X
>(NewX(1, 2))`. The purpose of WrapUnique is to automatically
deduce the pointer type. If you wish to make the type explicit, just use
`std::unique_ptr` directly.
auto x = std::unique_ptr
<X
>(NewX(1, 2));
- or -
std::unique_ptr
<X
> x(NewX(1, 2));
While `absl::WrapUnique` is useful for capturing the output of a raw
pointer factory, prefer 'absl::make_unique
<T
>(args...)' over
'absl::WrapUnique(new T(args...))'.
auto x = WrapUnique(new X(1, 2)); // works, but nonideal.
auto x = make_unique
<X
>(1, 2); // safer, standard, avoids raw 'new'.
Note that `absl::WrapUnique(p)` is valid only if `delete p` is a valid
expression. In particular, `absl::WrapUnique()` cannot wrap pointers to
arrays, functions or void, and it must not be used to capture pointers
obtained from array-new expressions (even though that would compile!).
Defined at line 72 of file ../../third_party/abseil-cpp/src/absl/memory/memory.h
-
uint32_t ghtonl (uint32_t x)Defined at line 73 of file ../../third_party/abseil-cpp/src/absl/base/internal/endian.h
-
uint64_t ghtonll (uint64_t x)Defined at line 74 of file ../../third_party/abseil-cpp/src/absl/base/internal/endian.h
-
uint16_t gntohs (uint16_t x)Defined at line 91 of file ../../third_party/abseil-cpp/src/absl/base/internal/endian.h
-
uint32_t gntohl (uint32_t x)Defined at line 92 of file ../../third_party/abseil-cpp/src/absl/base/internal/endian.h
-
uint64_t gntohll (uint64_t x)Defined at line 93 of file ../../third_party/abseil-cpp/src/absl/base/internal/endian.h
-
template <typename To>std::enable_if_t<!type_traits_internal::IsView<std::enable_if_t<!std::is_reference_v<To>, std::remove_cv_t<To>>>::value, To> implicit_cast (absl::type_identity_t<To> to)implicit_cast()
Performs an implicit conversion between types following the language
rules for implicit conversion; if an implicit conversion is otherwise
allowed by the language in the given context, this function performs such an
implicit conversion.
Example:
// If the context allows implicit conversion:
From from;
To to = from;
// Such code can be replaced by:
implicit_cast
<To
>(from);
An `implicit_cast()` may also be used to annotate numeric type conversions
that, although safe, may produce compiler warnings (such as `long` to `int`).
Additionally, an `implicit_cast()` is also useful within return statements to
indicate a specific implicit conversion is being undertaken.
Example:
return implicit_cast
<double
>(size_in_bytes) / capacity_;
Annotating code with `implicit_cast()` allows you to explicitly select
particular overloads and template instantiations, while providing a safer
cast than `reinterpret_cast()` or `static_cast()`.
Additionally, an `implicit_cast()` can be used to allow upcasting within a
type hierarchy where incorrect use of `static_cast()` could accidentally
allow downcasting.
Finally, an `implicit_cast()` can be used to perform implicit conversions
from unrelated types that otherwise couldn't be implicitly cast directly;
C++ will normally only implicitly cast "one step" in such conversions.
That is, if C is a type which can be implicitly converted to B, with B being
a type that can be implicitly converted to A, an `implicit_cast()` can be
used to convert C to B (which the compiler can then implicitly convert to A
using language rules).
Example:
// Assume an object C is convertible to B, which is implicitly convertible
// to A
A a = implicit_cast
<B
>(C);
Such implicit cast chaining may be useful within template logic.
Defined at line 96 of file ../../third_party/abseil-cpp/src/absl/base/casts.h
-
bool ascii_isalnum (unsigned char c)ascii_isalnum()
Determines whether the given character is an alphanumeric character.
Defined at line 98 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
const char * LogSeverityName (absl::LogSeverity s)LogSeverityName()
Returns the all-caps string representation (e.g. "INFO") of the specified
severity level if it is one of the standard levels and "UNKNOWN" otherwise.
Defined at line 101 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
template <typename To>std::enable_if_t<type_traits_internal::IsView<std::enable_if_t<!std::is_reference_v<To>, std::remove_cv_t<To>>>::value, To> implicit_cast (absl::type_identity_t<To> to)Defined at line 104 of file ../../third_party/abseil-cpp/src/absl/base/casts.h
-
bool ascii_isspace (unsigned char c)ascii_isspace()
Determines whether the given character is a whitespace character (space,
tab, vertical tab, formfeed, linefeed, or carriage return).
Defined at line 106 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename T>decltype(std::addressof(* ptr)) RawPtr (T && ptr)-----------------------------------------------------------------------------
Function Template: RawPtr()
-----------------------------------------------------------------------------
Extracts the raw pointer from a pointer-like value `ptr`. `absl::RawPtr` is
useful within templates that need to handle a complement of raw pointers,
`std::nullptr_t`, and smart pointers.
Defined at line 107 of file ../../third_party/abseil-cpp/src/absl/memory/memory.h
-
std::nullptr_t RawPtr (std::nullptr_t )Defined at line 111 of file ../../third_party/abseil-cpp/src/absl/memory/memory.h
-
template <typename To>std::enable_if_t<std::is_reference_v<To>, To> implicit_cast (absl::type_identity_t<To> to)Defined at line 112 of file ../../third_party/abseil-cpp/src/absl/base/casts.h
-
bool ascii_ispunct (unsigned char c)ascii_ispunct()
Determines whether the given character is a punctuation character.
Defined at line 113 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename FirstFormatter, typename SecondFormatter>strings_internal::PairFormatterImpl<FirstFormatter, SecondFormatter> PairFormatter (FirstFormatterf1,absl::string_viewsep,SecondFormatterf2)Function Template: PairFormatter(Formatter, absl::string_view, Formatter)
Formats a `std::pair` by putting a given separator between the pair's
`.first` and `.second` members. This formatter allows you to specify
custom Formatters for both the first and second member of each pair.
Defined at line 113 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
absl::LogSeverity NormalizeLogSeverity (absl::LogSeverity s)NormalizeLogSeverity()
Values less than `kInfo` normalize to `kInfo`; values greater than `kFatal`
normalize to `kError` (**NOT** `kFatal`).
Defined at line 115 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
bool ascii_isblank (unsigned char c)ascii_isblank()
Determines whether the given character is a blank character (tab or space).
Defined at line 120 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
absl::LogSeverity NormalizeLogSeverity (int s)Defined at line 121 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
strings_internal::PairFormatterImpl<strings_internal::AlphaNumFormatterImpl, strings_internal::AlphaNumFormatterImpl> PairFormatter (absl::string_view sep)Function overload of PairFormatter() for using a default
`AlphaNumFormatter()` for each Formatter in the pair.
Defined at line 121 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
bool ascii_iscntrl (unsigned char c)ascii_iscntrl()
Determines whether the given character is a control character.
Defined at line 127 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename T>str_format_internal::StreamedWrapper<T> FormatStreamed (const T & v)FormatStreamed()
Takes a streamable argument and returns an object that can print it
with '%s'. Allows printing of types that have an `operator
<
<
` but no
intrinsic type support within `StrFormat()` itself.
Example:
absl::StrFormat("%s", absl::FormatStreamed(obj));
Defined at line 133 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
bool ascii_isxdigit (unsigned char c)ascii_isxdigit()
Determines whether the given character can be represented as a hexadecimal
digit character (i.e. {0-9} or {A-F}).
Defined at line 135 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename Formatter>strings_internal::DereferenceFormatterImpl<Formatter> DereferenceFormatter (Formatter && f)Function Template: DereferenceFormatter(Formatter)
Formats its argument by dereferencing it and then applying the given
formatter. This formatter is useful for formatting a container of
pointer-to-T. This pattern often shows up when joining repeated fields in
protocol buffers.
Defined at line 135 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
template <typename T, typename D>std::shared_ptr<T> ShareUniquePtr (std::unique_ptr<T, D> && ptr)-----------------------------------------------------------------------------
Function Template: ShareUniquePtr()
-----------------------------------------------------------------------------
Adopts a `std::unique_ptr` rvalue and returns a `std::shared_ptr` of deduced
type. Ownership (if any) of the held value is transferred to the returned
shared pointer.
Example:
auto up = absl::make_unique
<int
>(10);
auto sp = absl::ShareUniquePtr(std::move(up)); // shared_ptr
<int
>
CHECK_EQ(*sp, 10);
CHECK(up == nullptr);
Note that this conversion is correct even when T is an array type, and more
generally it works for *any* deleter of the `unique_ptr` (single-object
deleter, array deleter, or any custom deleter), since the deleter is adopted
by the shared pointer as well. The deleter is copied (unless it is a
reference).
Implements the resolution of [LWG 2415](http://wg21.link/lwg2415), by which a
null shared pointer does not attempt to call the deleter.
Defined at line 137 of file ../../third_party/abseil-cpp/src/absl/memory/memory.h
-
bool ascii_isdigit (unsigned char c)ascii_isdigit()
Determines whether the given character can be represented as a decimal
digit character (i.e. {0-9}).
Defined at line 143 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
strings_internal::DereferenceFormatterImpl<strings_internal::AlphaNumFormatterImpl> DereferenceFormatter ()Function overload of `DereferenceFormatter()` for using a default
`AlphaNumFormatter()`.
Defined at line 143 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
template <typename T>std::weak_ptr<T> WeakenPtr (const std::shared_ptr<T> & ptr)-----------------------------------------------------------------------------
Function Template: WeakenPtr()
-----------------------------------------------------------------------------
Creates a weak pointer associated with a given shared pointer. The returned
value is a `std::weak_ptr` of deduced type.
Example:
auto sp = std::make_shared
<int
>(10);
auto wp = absl::WeakenPtr(sp);
CHECK_EQ(sp.get(), wp.lock().get());
sp.reset();
CHECK(wp.lock() == nullptr);
Defined at line 157 of file ../../third_party/abseil-cpp/src/absl/memory/memory.h
-
bool operator< (absl::LogSeverity lhs, absl::LogSeverityAtLeast rhs)Defined at line 176 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
bool operator<= (absl::LogSeverity lhs, absl::LogSeverityAtMost rhs)Defined at line 179 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
bool operator>= (absl::LogSeverityAtMost lhs, absl::LogSeverity rhs)Defined at line 179 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
bool operator== (int128 lhs, int128 rhs)Comparison operators.
Defined at line 193 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
bool operator< (int128 lhs, int128 rhs)Defined at line 201 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
bool operator> (int128 lhs, int128 rhs)Defined at line 205 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
bool operator<= (int128 lhs, int128 rhs)Defined at line 209 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
bool operator>= (int128 lhs, int128 rhs)Defined at line 213 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
template <typename Callable, typename... Args>void call_once (absl::once_flag &flag,Callable &&fn,Args &&...args)call_once()
For all invocations using a given `once_flag`, invokes a given `fn` exactly
once across all threads. The first call to `call_once()` with a particular
`once_flag` argument (that does not throw an exception) will run the
specified function with the provided `args`; other calls with the same
`once_flag` argument will not run the function, but will wait
for the provided function to finish running (if it is still running).
This mechanism provides a safe, simple, and fast mechanism for one-time
initialization in a multi-threaded process.
Example:
class MyInitClass {
public:
...
mutable absl::once_flag once_;
MyInitClass* init() const {
absl::call_once(once_,
&MyInitClass
::Init, this);
return ptr_;
}
Defined at line 213 of file ../../third_party/abseil-cpp/src/absl/base/call_once.h
-
void PrefetchToLocalCache (const void * addr)Moves data into the L1 cache before it is read, or "prefetches" it.
The value of `addr` is the address of the memory to prefetch. If
the target and compiler support it, data prefetch instructions are
generated. If the prefetch is done some time before the memory is
read, it may be in the cache by the time the read occurs.
This method prefetches data with the highest degree of temporal locality;
data is prefetched where possible into all levels of the cache.
Incorrect or gratuitous use of this function can degrade performance.
Use this function only when representative benchmarks show an improvement.
Example:
// Computes incremental checksum for `data`.
int ComputeChecksum(int sum, absl::string_view data);
// Computes cumulative checksum for all values in `data`
int ComputeChecksum(absl::Span
<const
std::string> data) {
int sum = 0;
auto it = data.begin();
auto pit = data.begin();
auto end = data.end();
for (int dist = 8; dist > 0
&
&
pit != data.end(); --dist, ++pit) {
absl::PrefetchToLocalCache(pit->data());
}
for (; pit != end; ++pit, ++it) {
sum = ComputeChecksum(sum, *it);
absl::PrefetchToLocalCache(pit->data());
}
for (; it != end; ++it) {
sum = ComputeChecksum(sum, *it);
}
return sum;
}
Defined at line 145 of file ../../third_party/abseil-cpp/src/absl/base/prefetch.h
-
template <typename H>H AbslHashValue (H h, uint128 v)Support for absl::Hash.
Defined at line 218 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
absl::strong_ordering operator<=> (int128 lhs, int128 rhs)Defined at line 218 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
template <typename S>void AbslStringify (S & sink, Hex hex)Defined at line 221 of file ../../third_party/abseil-cpp/src/absl/strings/str_cat.h
-
template <typename Sink>void AbslStringify (Sink & sink, uint128 v)Support for absl::StrCat() etc.
Defined at line 228 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
int128 operator- (int128 v)Arithmetic operators.
Defined at line 233 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
bool operator! (int128 v)Defined at line 235 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
int128 operator~ (int128 val)Defined at line 237 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
template <typename H>H AbslHashValue (H h, Duration d)Defined at line 239 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename S>void AbslStringify (S & sink, Dec dec)Defined at line 276 of file ../../third_party/abseil-cpp/src/absl/strings/str_cat.h
-
template <typename Sink>void AbslStringify (Sink & sink, const Status & status)Support `absl::StrCat`, `absl::StrFormat`, etc.
Defined at line 533 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
void AbslFormatFlush (absl::Cord * _Nonnull cord, absl::string_view part)Supports absl::Cord as a sink object for absl::Format().
Defined at line 785 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
template <typename Sink>void AbslStringify (Sink & sink, const absl::Cord & cord)Support automatic stringification with absl::StrCat and absl::StrFormat.
Defined at line 792 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
template <typename H>H AbslHashValue (H hash_state, const absl::Cord & c)Defined at line 822 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool StrContainsIgnoreCase (absl::string_view haystack, absl::string_view needle)StrContainsIgnoreCase()
Returns whether a given ASCII string `haystack` contains the ASCII substring
`needle`, ignoring case in the comparison.
-
bool StrContainsIgnoreCase (absl::string_view haystack, char needle) -
bool EqualsIgnoreCase (absl::string_view piece1, absl::string_view piece2)EqualsIgnoreCase()
Returns whether given ASCII strings `piece1` and `piece2` are equal, ignoring
case in the comparison.
-
void CopyCordToString (const Cord & src, std::string * _Nonnull dst)CopyCordToString()
Copies the contents of a `src` Cord into a `*dst` string.
This function optimizes the case of reusing the destination string since it
can reuse previously allocated capacity. However, this function does not
guarantee that pointers previously returned by `dst->data()` remain valid
even if `*dst` had enough capacity to hold `src`. If `*dst` is a new
object, prefer to simply use the conversion operator to `std::string`.
-
bool StartsWithIgnoreCase (absl::string_view text, absl::string_view prefix)StartsWithIgnoreCase()
Returns whether a given ASCII string `text` starts with `prefix`,
ignoring case in the comparison.
-
void AppendCordToString (const Cord & src, std::string * _Nonnull dst)AppendCordToString()
Appends the contents of a `src` Cord to a `*dst` string.
This function optimizes the case of appending to a non-empty destination
string. If `*dst` already has capacity to store the contents of the cord,
this function does not invalidate pointers previously returned by
`dst->data()`. If `*dst` is a new object, prefer to simply use the
conversion operator to `std::string`.
-
bool EndsWithIgnoreCase (absl::string_view text, absl::string_view suffix)EndsWithIgnoreCase()
Returns whether a given ASCII string `text` ends with `suffix`, ignoring
case in the comparison.
-
absl::string_view FindLongestCommonPrefix (absl::string_view a, absl::string_view b)Yields the longest prefix in common between both input strings.
Pointer-wise, the returned result is a subset of input "a".
-
absl::string_view FindLongestCommonSuffix (absl::string_view a, absl::string_view b)Yields the longest suffix in common between both input strings.
Pointer-wise, the returned result is a subset of input "a".
-
crc32c_t RemoveCrc32cPrefix (crc32c_tprefix_crc,crc32c_tfull_string_crc,size_tremaining_string_length)RemoveCrc32cPrefix()
Calculates the CRC32C value of an existing buffer with a series of bytes
(the prefix) removed from the beginning of that buffer.
Given the CRC32C value of an existing buffer, `full_string_crc`; The CRC32C
value of a prefix of that buffer, `prefix_crc`; and the length of the buffer
with the prefix removed, `remaining_string_length` , return the CRC32C
value of the buffer with the prefix removed.
This operation has a runtime cost of O(log(`remaining_string_length`)).
-
crc32c_t RemoveCrc32cSuffix (crc32c_tfull_string_crc,crc32c_tsuffix_crc,size_tsuffix_length)RemoveCrc32cSuffix()
Calculates the CRC32C value of an existing buffer with a series of bytes
(the suffix) removed from the end of that buffer.
Given a CRC32C value of an existing buffer `full_string_crc`, the CRC32C
value of the suffix to remove `suffix_crc`, and the length of that suffix
`suffix_len`, returns the CRC32C value of the buffer with suffix removed.
This operation has a runtime cost of O(log(`suffix_len`))
-
void AsciiStrToLower (std::string * _Nonnull s)Converts the characters in `s` to lowercase, changing the contents of `s`.
-
void AsciiStrToUpper (std::string * _Nonnull s)Converts the characters in `s` to uppercase, changing the contents of `s`.
-
std::string StatusCodeToString (StatusCode code)StatusCodeToString()
Returns the name for the status code, or "" if it is an unknown value.
-
absl::string_view StatusCodeToStringView (StatusCode code)StatusCodeToStringView()
Same as StatusCodeToString(), but returns a string_view.
-
int64_t IDivDuration (Durationnum,Durationden,Duration *rem)IDivDuration()
Divides a numerator `Duration` by a denominator `Duration`, returning the
quotient and remainder. The remainder always has the same sign as the
numerator. The returned quotient and remainder respect the identity:
numerator = denominator * quotient + remainder
Returned quotients are capped to the range of `int64_t`, with the difference
spilling into the remainder to uphold the above identity. This means that the
remainder returned could differ from the remainder returned by
`Duration::operator%` for huge quotients.
See also the notes on `InfiniteDuration()` below regarding the behavior of
division involving zero and infinite durations.
Example:
constexpr absl::Duration a =
absl::Seconds(std::numeric_limits
<int64
_t>::max()); // big
constexpr absl::Duration b = absl::Nanoseconds(1); // small
absl::Duration rem = a % b;
// rem == absl::ZeroDuration()
// Here, q would overflow int64_t, so rem accounts for the difference.
int64_t q = absl::IDivDuration(a, b,
&rem
);
// q == std::numeric_limits
<int64
_t>::max(), rem == a - b * q
-
double FDivDuration (Duration num, Duration den)FDivDuration()
Divides a `Duration` numerator into a fractional number of units of a
`Duration` denominator.
See also the notes on `InfiniteDuration()` below regarding the behavior of
division involving zero and infinite durations.
Example:
double d = absl::FDivDuration(absl::Milliseconds(1500), absl::Seconds(1));
// d == 1.5
-
Duration Ceil (Duration d, Duration unit)Ceil()
Returns the ceiling of a duration using the passed duration unit to its
smallest value not less than the duration.
Example:
absl::Duration d = absl::Nanoseconds(123456789);
absl::Duration c = absl::Ceil(d, absl::Microseconds(1)); // 123457us
-
bool ParseCivilTime (absl::string_view s, CivilDay * c) -
bool ParseCivilTime (absl::string_view s, CivilMonth * c) -
bool ParseCivilTime (absl::string_view s, CivilYear * c) -
bool ParseLenientCivilTime (absl::string_view s, CivilSecond * c)ParseLenientCivilTime()
Parses any of the formats accepted by `absl::ParseCivilTime()`, but is more
lenient if the format of the string does not exactly match the associated
type.
Example:
absl::CivilDay d;
bool ok = absl::ParseLenientCivilTime("1969-07-20",
&d
); // OK
ok = absl::ParseLenientCivilTime("1969-07-20T10",
&d
); // OK: T10 floored
ok = absl::ParseLenientCivilTime("1969-07",
&d
); // OK: day defaults to 1
-
bool ParseLenientCivilTime (absl::string_view s, CivilMinute * c) -
bool ParseLenientCivilTime (absl::string_view s, CivilHour * c) -
bool ParseLenientCivilTime (absl::string_view s, CivilDay * c) -
bool ParseLenientCivilTime (absl::string_view s, CivilMonth * c) -
bool ParseLenientCivilTime (absl::string_view s, CivilYear * c) -
bool IsUnknown (const Status & status) -
Status AbortedError (absl::string_view message)AbortedError()
AlreadyExistsError()
CancelledError()
DataLossError()
DeadlineExceededError()
FailedPreconditionError()
InternalError()
InvalidArgumentError()
NotFoundError()
OutOfRangeError()
PermissionDeniedError()
ResourceExhaustedError()
UnauthenticatedError()
UnavailableError()
UnimplementedError()
UnknownError()
These convenience functions create an `absl::Status` object with an error
code as indicated by the associated function name, using the error message
passed in `message`.
-
Status AlreadyExistsError (absl::string_view message) -
Status CancelledError (absl::string_view message) -
Status DataLossError (absl::string_view message) -
Status DeadlineExceededError (absl::string_view message) -
Status FailedPreconditionError (absl::string_view message) -
Status InternalError (absl::string_view message) -
Status InvalidArgumentError (absl::string_view message) -
Status NotFoundError (absl::string_view message) -
Status OutOfRangeError (absl::string_view message) -
Status PermissionDeniedError (absl::string_view message) -
Status ResourceExhaustedError (absl::string_view message) -
absl::string_view StripPrefix (absl::string_view str, absl::string_view prefix)StripPrefix()
Returns a view into the input string `str` with the given `prefix` removed,
but leaving the original string intact. If the prefix does not match at the
start of the string, returns the original string instead.
Defined at line 77 of file ../../third_party/abseil-cpp/src/absl/strings/strip.h
-
absl::string_view StripSuffix (absl::string_view str, absl::string_view suffix)StripSuffix()
Returns a view into the input string `str` with the given `suffix` removed,
but leaving the original string intact. If the suffix does not match at the
end of the string, returns the original string instead.
Defined at line 89 of file ../../third_party/abseil-cpp/src/absl/strings/strip.h
-
Status UnauthenticatedError (absl::string_view message) -
Status UnavailableError (absl::string_view message) -
Status UnimplementedError (absl::string_view message) -
Status UnknownError (absl::string_view message) -
absl::StatusCode ErrnoToStatusCode (int error_number)ErrnoToStatusCode()
Returns the StatusCode for `error_number`, which should be an `errno` value.
See https://en.cppreference.com/w/cpp/error/errno_macros and similar
references.
-
Status ErrnoToStatus (int error_number, absl::string_view message)ErrnoToStatus()
Convenience function that creates a `absl::Status` using an `error_number`,
which should be an `errno` value.
-
const CordzInfo * _Nullable GetCordzInfoForTesting (const Cord & cord) -
const char * _Nonnull StatusMessageAsCStr (const Status & status)Retrieves a message's status as a null terminated C string. The lifetime of
this string is tied to the lifetime of the status object itself.
If the status's message is empty, the empty string is returned.
StatusMessageAsCStr exists for C support. Use `status.message()` in C++.
-
template <typename ResultType, typename RHS>ResultType GenericCompare (const Cord &lhs,const RHS &rhs,size_tsize_to_compare) -
bool operator== (crc32c_t lhs, crc32c_t rhs)Defined at line 59 of file ../../third_party/abseil-cpp/src/absl/crc/crc32c.h
-
bool operator!= (crc32c_t lhs, crc32c_t rhs)Defined at line 63 of file ../../third_party/abseil-cpp/src/absl/crc/crc32c.h
-
template <typename Sink>void AbslStringify (Sink & sink, crc32c_t crc)Defined at line 66 of file ../../third_party/abseil-cpp/src/absl/crc/crc32c.h
-
crc32c_t ExtendCrc32c (crc32c_t initial_crc, absl::string_view buf_to_add)ExtendCrc32c()
Computes a CRC32C value from an `initial_crc` CRC32C value including the
`buf_to_add` bytes of an additional buffer. Using this function is more
efficient than computing a CRC32C value for the combined buffer from
scratch.
Note: `ExtendCrc32c` with an initial_crc of 0 is equivalent to
`ComputeCrc32c`.
This operation has a runtime cost of O(`buf_to_add.size()`)
Defined at line 97 of file ../../third_party/abseil-cpp/src/absl/crc/crc32c.h
-
crc32c_t ComputeCrc32c (absl::string_view buf)ComputeCrc32c()
Returns the CRC32C value of the provided string.
Defined at line 113 of file ../../third_party/abseil-cpp/src/absl/crc/crc32c.h
-
crc32c_t ExtendCrc32cByZeroes (crc32c_t initial_crc, size_t length)ExtendCrc32cByZeroes()
Computes a CRC32C value for a buffer with an `initial_crc` CRC32C value,
where `length` bytes with a value of 0 are appended to the buffer. Using this
function is more efficient than computing a CRC32C value for the combined
buffer from scratch.
This operation has a runtime cost of O(log(`length`))
-
template <typename C, typename EqualityComparable>bool c_linear_search (const C & c, EqualityComparable && value)c_linear_search()
Container-based version of absl::linear_search() for performing a linear
search within a container.
For a generalization that uses a predicate, see absl::c_any_of().
Defined at line 135 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
bool ascii_isprint (unsigned char c)ascii_isprint()
Determines whether the given character is printable, including spaces.
Defined at line 150 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
void PrefetchToLocalCacheNta (const void * addr)Moves data into the L1 cache before it is read, or "prefetches" it.
This function is identical to `PrefetchToLocalCache()` except that it has
non-temporal locality: the fetched data should not be left in any of the
cache tiers. This is useful for cases where the data is used only once /
short term, for example, invoking a destructor on an object.
Incorrect or gratuitous use of this function can degrade performance.
Use this function only when representative benchmarks show an improvement.
Example:
template
<typename
Iterator>
void DestroyPointers(Iterator begin, Iterator end) {
size_t distance = std::min(8U, bars.size());
int dist = 8;
auto prefetch_it = begin;
while (prefetch_it != end
&
&
--dist;) {
absl::PrefetchToLocalCacheNta(*prefetch_it++);
}
while (prefetch_it != end) {
delete *begin++;
absl::PrefetchToLocalCacheNta(*prefetch_it++);
}
while (begin != end) {
delete *begin++;
}
}
Defined at line 150 of file ../../third_party/abseil-cpp/src/absl/base/prefetch.h
-
template <typename C>container_algorithm_internal::ContainerDifferenceType<const C> c_distance (const C & c)c_distance()
Container-based version of the
<iterator
> `std::distance()` function to
return the number of elements within a container.
Defined at line 151 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
void PrefetchToLocalCacheForWrite (const void * addr)Moves data into the L1 cache with the intent to modify it.
This function is similar to `PrefetchToLocalCache()` except that it
prefetches cachelines with an 'intent to modify' This typically includes
invalidating cache entries for this address in all other cache tiers, and an
exclusive access intent.
Incorrect or gratuitous use of this function can degrade performance. As this
function can invalidate cached cachelines on other caches and computer cores,
incorrect usage of this function can have an even greater negative impact
than incorrect regular prefetches.
Use this function only when representative benchmarks show an improvement.
Example:
void* Arena::Allocate(size_t size) {
void* ptr = AllocateBlock(size);
absl::PrefetchToLocalCacheForWrite(ptr);
return ptr;
}
Defined at line 155 of file ../../third_party/abseil-cpp/src/absl/base/prefetch.h
-
template <typename T>NoDestructor<T> <deduction guide for NoDestructor> (T )Provide 'Class Template Argument Deduction': the type of NoDestructor's T
will be the same type as the argument passed to NoDestructor's constructor.
-
bool ascii_isalpha (unsigned char c)ascii_isalpha()
Determines whether the given character is an alphabetic character.
Defined at line 91 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
bool ascii_isgraph (unsigned char c)ascii_isgraph()
Determines whether the given character has a graphical representation.
Defined at line 157 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
bool ascii_isupper (unsigned char c)ascii_isupper()
Determines whether the given character is uppercase.
Defined at line 164 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename C, typename Pred>bool c_all_of (const C & c, Pred && pred)c_all_of()
Container-based version of the
<algorithm
> `std::all_of()` function to
test if all elements within a container satisfy a condition.
Defined at line 167 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
bool ascii_islower (unsigned char c)ascii_islower()
Determines whether the given character is lowercase.
Defined at line 171 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
bool ascii_isascii (unsigned char c)ascii_isascii()
Determines whether the given character is ASCII.
Defined at line 178 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename C, typename Pred>bool c_any_of (const C & c, Pred && pred)c_any_of()
Container-based version of the
<algorithm
> `std::any_of()` function to
test if any element in a container fulfills a condition.
Defined at line 178 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T, typename Op>void StringResizeAndOverwrite (T &str,typename T::size_typen,Opop)Resizes `str` to contain at most `n` characters, using the user-provided
operation `op` to modify the possibly indeterminate contents. `op` must
return the finalized length of `str`.
Invalidates all iterators, pointers, and references into `str`, regardless
of whether reallocation occurs.
`op(value_type* buf, size_t buf_size)` is allowed to write `value_type{}` to
`buf[buf_size]`, which facilitiates interoperation with functions that write
a trailing NUL. Please note that this requirement is more strict than
`basic_string::resize_and_overwrite()`, which allows writing an abitrary
value to `buf[buf_size]`.
Defined at line 182 of file ../../third_party/abseil-cpp/src/absl/strings/resize_and_overwrite.h
-
char ascii_tolower (unsigned char c)ascii_tolower()
Returns an ASCII character, converting to lowercase if uppercase is
passed. Note that character values > 127 are simply returned.
Defined at line 184 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename C, typename Pred>bool c_none_of (const C & c, Pred && pred)c_none_of()
Container-based version of the
<algorithm
> `std::none_of()` function to
test if no elements in a container fulfill a condition.
Defined at line 189 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
std::string AsciiStrToLower (absl::string_view s)Creates a lowercase string from a given absl::string_view.
Defined at line 192 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename C, typename Function>decay_t<Function> c_for_each (C && c, Function && f)c_for_each()
Container-based version of the
<algorithm
> `std::for_each()` function to
apply a function to a container's elements.
Defined at line 200 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <int&... DoNotSpecify>std::string AsciiStrToLower (std::string && s)Creates a lowercase string from a given std::string
&
&
.
(Template is used to lower priority of this overload.)
Defined at line 205 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename C, typename T>container_algorithm_internal::ContainerIter<C> c_find (C & c, T && value)c_find()
Container-based version of the
<algorithm
> `std::find()` function to find
the first element containing the passed value within a container value.
Defined at line 212 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
char ascii_toupper (unsigned char c)ascii_toupper()
Returns the ASCII character, converting to upper-case if lower-case is
passed. Note that characters values > 127 are simply returned.
Defined at line 215 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
std::string AsciiStrToUpper (absl::string_view s)Creates an uppercase string from a given absl::string_view.
Defined at line 223 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename Sequence, typename T>bool c_contains (const Sequence & sequence, T && value)c_contains()
Container-based version of the
<algorithm
> `std::ranges::contains()` C++23
function to search a container for a value.
Defined at line 225 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <int&... DoNotSpecify>std::string AsciiStrToUpper (std::string && s)Creates an uppercase string from a given std::string
&
&
.
(Template is used to lower priority of this overload.)
Defined at line 236 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename C, typename Pred>container_algorithm_internal::ContainerIter<C> c_find_if (C & c, Pred && pred)c_find_if()
Container-based version of the
<algorithm
> `std::find_if()` function to find
the first element in a container matching the given condition.
Defined at line 236 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Iterator, typename Formatter>std::string StrJoin (Iteratorstart,Iteratorend,absl::string_viewsep,Formatter &&fmt)-----------------------------------------------------------------------------
StrJoin()
-----------------------------------------------------------------------------
Joins a range of elements and returns the result as a std::string.
`absl::StrJoin()` takes a range, a separator string to use between the
elements joined, and an optional Formatter responsible for converting each
argument in the range to a string.
If omitted, the default `AlphaNumFormatter()` is called on the elements to be
joined.
Example 1:
// Joins a collection of strings. This pattern also works with a collection
// of `absl::string_view` or even `const char*`.
std::vector
<std
::string> v = {"foo", "bar", "baz"};
std::string s = absl::StrJoin(v, "-");
EXPECT_EQ(s, "foo-bar-baz");
Example 2:
// Joins the values in the given `std::initializer_list
<
>` specified using
// brace initialization. This pattern also works with an initializer_list
// of ints or `absl::string_view` -- any `AlphaNum`-compatible type.
std::string s = absl::StrJoin({"foo", "bar", "baz"}, "-");
EXPECT_EQs, "foo-bar-baz");
Example 3:
// Joins a collection of ints. This pattern also works with floats,
// doubles, int64s -- any `StrCat()`-compatible type.
std::vector
<int
> v = {1, 2, 3, -4};
std::string s = absl::StrJoin(v, "-");
EXPECT_EQ(s, "1-2-3--4");
Example 4:
// Joins a collection of pointer-to-int. By default, pointers are
// dereferenced and the pointee is formatted using the default format for
// that type; such dereferencing occurs for all levels of indirection, so
// this pattern works just as well for `std::vector
<int
**>` as for
// `std::vector
<int
*>`.
int x = 1, y = 2, z = 3;
std::vector
<int
*> v = {
&x
,
&y
,
&z
};
std::string s = absl::StrJoin(v, "-");
EXPECT_EQ(s, "1-2-3");
Example 5:
// Dereferencing of `std::unique_ptr
<
>` is also supported:
std::vector
<std
::unique_ptr
<int
>> v
v.emplace_back(new int(1));
v.emplace_back(new int(2));
v.emplace_back(new int(3));
std::string s = absl::StrJoin(v, "-");
EXPECT_EQ(s, "1-2-3");
Example 6:
// Joins a `std::map`, with each key-value pair separated by an equals
// sign. This pattern would also work with, say, a
// `std::vector
<std
::pair
<
>>`.
std::map
<std
::string, int> m = {
{"a", 1},
{"b", 2},
{"c", 3}};
std::string s = absl::StrJoin(m, ",", absl::PairFormatter("="));
EXPECT_EQ(s, "a=1,b=2,c=3");
Example 7:
// These examples show how `absl::StrJoin()` handles a few common edge
// cases:
std::vector
<std
::string> v_empty;
EXPECT_EQ(absl::StrJoin(v_empty, "-"), "");
std::vector
<std
::string> v_one_item = {"foo"};
EXPECT_EQ(absl::StrJoin(v_one_item, "-"), "foo");
std::vector
<std
::string> v_empty_string = {""};
EXPECT_EQ(absl::StrJoin(v_empty_string, "-"), "");
std::vector
<std
::string> v_one_item_empty_string = {"a", ""};
EXPECT_EQ(absl::StrJoin(v_one_item_empty_string, "-"), "a-");
std::vector
<std
::string> v_two_empty_string = {"", ""};
EXPECT_EQ(absl::StrJoin(v_two_empty_string, "-"), "-");
Example 8:
// Joins a `std::tuple
<T
...>` of heterogeneous types, converting each to
// a std::string using the `absl::AlphaNum` class.
std::string s = absl::StrJoin(std::make_tuple(123, "abc", 0.456), "-");
EXPECT_EQ(s, "123-abc-0.456");
Defined at line 239 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
int128 operator+ (int128 lhs, int128 rhs)Arithmetic operators.
Defined at line 241 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
absl::string_view StripLeadingAsciiWhitespace (absl::string_view str)Returns absl::string_view with whitespace stripped from the beginning of the
given string_view.
Defined at line 244 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
int128 operator- (int128 lhs, int128 rhs)Defined at line 245 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
template <typename Range, typename Formatter>std::string StrJoin (const Range &range,absl::string_viewseparator,Formatter &&fmt)Defined at line 245 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
template <typename C, typename Pred>container_algorithm_internal::ContainerIter<C> c_find_if_not (C & c, Pred && pred)c_find_if_not()
Container-based version of the
<algorithm
> `std::find_if_not()` function to
find the first element in a container not matching the given condition.
Defined at line 249 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename To, typename From>To down_cast (From * f)Defined at line 249 of file ../../third_party/abseil-cpp/src/absl/base/casts.h
-
int128 operator* (int128 lhs, int128 rhs)Defined at line 250 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
void StripLeadingAsciiWhitespace (std::string * _Nonnull str)Strips in place whitespace from the beginning of the given string.
Defined at line 251 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename T,typename Formatter,typename = typename std::enable_if< !std::is_convertible<T, absl::string_view>::value>::type>std::string StrJoin (std::initializer_list<T>il,absl::string_viewseparator,Formatter &&fmt)Defined at line 253 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
int128 operator/ (int128 lhs, int128 rhs)Defined at line 254 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
int128 operator% (int128 lhs, int128 rhs)Defined at line 258 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
absl::string_view StripTrailingAsciiWhitespace (absl::string_view str)Returns absl::string_view with whitespace stripped from the end of the given
string_view.
Defined at line 258 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename Formatter>std::string StrJoin (std::initializer_list<absl::string_view>il,absl::string_viewseparator,Formatter &&fmt)Defined at line 259 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
template <typename Sequence1, typename Sequence2>container_algorithm_internal::ContainerIter<Sequence1> c_find_end (Sequence1 & sequence, Sequence2 & subsequence)c_find_end()
Container-based version of the
<algorithm
> `std::find_end()` function to
find the last subsequence within a container.
Defined at line 262 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
void StripTrailingAsciiWhitespace (std::string * _Nonnull str)Strips in place whitespace from the end of the given string
Defined at line 265 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename... T, typename Formatter>std::string StrJoin (const std::tuple<T...> &value,absl::string_viewseparator,Formatter &&fmt)Defined at line 265 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
template <typename Iterator>std::string StrJoin (Iteratorstart,Iteratorend,absl::string_viewseparator)Defined at line 271 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
absl::string_view StripAsciiWhitespace (absl::string_view str)Returns absl::string_view with whitespace stripped from both ends of the
given string_view.
Defined at line 272 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <int&... ExplicitArgumentBarrier, typename... Types>size_t HashOf (const Types &... values)HashOf
absl::HashOf() is a helper that generates a hash from the values of its
arguments. It dispatches to absl::Hash directly, as follows:
* HashOf(t) == absl::Hash
<T
>{}(t)
* HashOf(a, b, c) == HashOf(std::make_tuple(a, b, c))
HashOf(a1, a2, ...) == HashOf(b1, b2, ...) is guaranteed when
* The argument lists have pairwise identical C++ types
* a1 == b1
&
&
a2 == b2
&
&
...
The requirement that the arguments match in both type and value is critical.
It means that `a == b` does not necessarily imply `HashOf(a) == HashOf(b)` if
`a` and `b` have different types. For example, `HashOf(2) != HashOf(2.0)`.
Defined at line 273 of file ../../third_party/abseil-cpp/src/absl/hash/hash.h
-
crc32c_t MemcpyCrc32c (void *dest,const void *src,size_tcount,crc32c_tinitial_crc)MemcpyCrc32c()
Copies `src` to `dest` using `memcpy()` semantics, returning the CRC32C
value of the copied buffer.
Using `MemcpyCrc32c()` is potentially faster than performing the `memcpy()`
and `ComputeCrc32c()` operations separately.
-
crc32c_t ConcatCrc32c (crc32c_tcrc1,crc32c_tcrc2,size_tcrc2_length)ConcatCrc32c()
Calculates the CRC32C value of two buffers with known CRC32C values
concatenated together.
Given a buffer with CRC32C value `crc1` and a buffer with
CRC32C value `crc2` and length, `crc2_length`, returns the CRC32C value of
the concatenation of these two buffers.
This operation has a runtime cost of O(log(`crc2_length`)).
-
std::ostream & operator<< (std::ostream & os, crc32c_t crc)operator
<
<
Streams the CRC32C value `crc` to the stream `os`.
Defined at line 185 of file ../../third_party/abseil-cpp/src/absl/crc/crc32c.h
-
template <class T>T byteswap (T x)Defined at line 240 of file ../../third_party/abseil-cpp/src/absl/numeric/bits.h
-
template <typename Sequence1,typename Sequence2,typename BinaryPredicate>container_algorithm_internal::ContainerIter<Sequence1> c_find_end (Sequence1 &sequence,Sequence2 &subsequence,BinaryPredicate &&pred)Overload of c_find_end() for using a predicate evaluation other than `==` as
the function's test condition.
Defined at line 274 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Range>std::string StrJoin (const Range & range, absl::string_view separator)Defined at line 276 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
void StripAsciiWhitespace (std::string * _Nonnull str)Strips in place whitespace from both ends of the given string
Defined at line 278 of file ../../third_party/abseil-cpp/src/absl/strings/ascii.h
-
template <typename To, typename From>To down_cast (From & f)Overload of down_cast for references. Use like this:
absl::down_cast
<T
&
>(foo). The code is slightly convoluted because we're still
using the pointer form of dynamic cast. (The reference form throws an
exception if it fails.)
There's no need for a special const overload either for the pointer
or the reference form. If you call down_cast with a const T
&
, the
compiler will just bind From to const T.
Defined at line 280 of file ../../third_party/abseil-cpp/src/absl/base/casts.h
-
template <typename T, typename = typename std::enable_if<!std::is_convertible< T, absl::string_view>::value>::type>std::string StrJoin (std::initializer_list<T> il, absl::string_view separator)Defined at line 282 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
int128 operator| (int128 lhs, int128 rhs)Defined at line 285 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
std::string StrJoin (std::initializer_list<absl::string_view> il, absl::string_view separator)Defined at line 286 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
int128 operator& (int128 lhs, int128 rhs)Defined at line 289 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
template <typename C1, typename C2>container_algorithm_internal::ContainerIter<C1> c_find_first_of (C1 & container, const C2 & options)c_find_first_of()
Container-based version of the
<algorithm
> `std::find_first_of()` function to
find the first element within the container that is also within the options
container.
Defined at line 291 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename... T>std::string StrJoin (const std::tuple<T...> & value, absl::string_view separator)Defined at line 292 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
int128 operator^ (int128 lhs, int128 rhs)Defined at line 293 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
int128 operator<< (int128 lhs, int amount)Defined at line 297 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
int128 operator>> (int128 lhs, int amount)Defined at line 301 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
bool operator!= (int128 lhs, int128 rhs)Forward declaration for comparison operators.
Defined at line 197 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
bool operator== (const AnyInvocable<Sig> & f, std::nullptr_t )Returns `true` if `f` is empty.
Defined at line 303 of file ../../third_party/abseil-cpp/src/absl/functional/any_invocable.h
-
template <typename C1,typename C2,typename BinaryPredicate>container_algorithm_internal::ContainerIter<C1> c_find_first_of (C1 &container,const C2 &options,BinaryPredicate &&pred)Overload of c_find_first_of() for using a predicate evaluation other than
`==` as the function's test condition.
Defined at line 303 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
bool operator== (std::nullptr_t , const AnyInvocable<Sig> & f)Returns `true` if `f` is empty.
Defined at line 308 of file ../../third_party/abseil-cpp/src/absl/functional/any_invocable.h
-
template <typename Delimiter>strings_internal::MaxSplitsImpl<typename strings_internal::SelectDelimiter<Delimiter>::type> MaxSplits (Delimiter delimiter, int limit)MaxSplits()
A delimiter that limits the number of matches which can occur to the passed
`limit`. The last element in the returned collection will contain all
remaining unsplit pieces, which may contain instances of the delimiter.
The collection will contain at most `limit` + 1 elements.
Example:
using absl::MaxSplits;
std::vector
<std
::string> v = absl::StrSplit("a,b,c", MaxSplits(',', 1));
// v[0] == "a", v[1] == "b,c"
Defined at line 310 of file ../../third_party/abseil-cpp/src/absl/strings/str_split.h
-
bool operator!= (const AnyInvocable<Sig> & f, std::nullptr_t )Returns `false` if `f` is empty.
Defined at line 313 of file ../../third_party/abseil-cpp/src/absl/functional/any_invocable.h
-
StatusToStringMode operator& (StatusToStringMode lhs, StatusToStringMode rhs)absl::StatusToStringMode is specified as a bitmask type, which means the
following operations must be provided:
Defined at line 316 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
bool operator!= (std::nullptr_t , const AnyInvocable<Sig> & f)Returns `false` if `f` is empty.
Defined at line 318 of file ../../third_party/abseil-cpp/src/absl/functional/any_invocable.h
-
template <typename Sequence>container_algorithm_internal::ContainerIter<Sequence> c_adjacent_find (Sequence & sequence)c_adjacent_find()
Container-based version of the
<algorithm
> `std::adjacent_find()` function to
find equal adjacent elements within a container.
Defined at line 318 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
void swap (AnyInvocable<Sig> & f1, AnyInvocable<Sig> & f2)swap()
Exchanges the targets of `f1` and `f2`.
Defined at line 325 of file ../../third_party/abseil-cpp/src/absl/functional/any_invocable.h
-
template <typename int_type>bool SimpleAtoi (absl::string_view str, int_type * _Nonnull out)SimpleAtoi()
Converts the given string (optionally followed or preceded by ASCII
whitespace) into an integer value, returning `true` if successful. The string
must reflect a base-10 integer whose value falls within the range of the
integer type (optionally preceded by a `+` or `-`). If any errors are
encountered, this function returns `false`, leaving `out` in an unspecified
state.
Defined at line 325 of file ../../third_party/abseil-cpp/src/absl/strings/numbers.h
-
bool SimpleAtof (absl::string_view str, float * _Nonnull out)SimpleAtof()
Converts the given string (optionally followed or preceded by ASCII
whitespace) into a float, which may be rounded on overflow or underflow,
returning `true` if successful.
See https://en.cppreference.com/w/c/string/byte/strtof for details about the
allowed formats for `str`, except SimpleAtof() is locale-independent and will
always use the "C" locale. If any errors are encountered, this function
returns `false`, leaving `out` in an unspecified state.
-
bool SimpleAtod (absl::string_view str, double * _Nonnull out)SimpleAtod()
Converts the given string (optionally followed or preceded by ASCII
whitespace) into a double, which may be rounded on overflow or underflow,
returning `true` if successful.
See https://en.cppreference.com/w/c/string/byte/strtof for details about the
allowed formats for `str`, except SimpleAtod is locale-independent and will
always use the "C" locale. If any errors are encountered, this function
returns `false`, leaving `out` in an unspecified state.
-
bool SimpleAtob (absl::string_view str, bool * _Nonnull out)SimpleAtob()
Converts the given string into a boolean, returning `true` if successful.
The following case-insensitive strings are interpreted as boolean `true`:
"true", "t", "yes", "y", "1". The following case-insensitive strings
are interpreted as boolean `false`: "false", "f", "no", "n", "0". If any
errors are encountered, this function returns `false`, leaving `out` in an
unspecified state.
-
template <typename Sequence, typename BinaryPredicate>container_algorithm_internal::ContainerIter<Sequence> c_adjacent_find (Sequence & sequence, BinaryPredicate && pred)Overload of c_adjacent_find() for using a predicate evaluation other than
`==` as the function's test condition.
Defined at line 328 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
bool SimpleAtoi (absl::string_view str, absl::int128 * _Nonnull out)Defined at line 330 of file ../../third_party/abseil-cpp/src/absl/strings/numbers.h
-
bool SimpleAtoi (absl::string_view str, absl::uint128 * _Nonnull out)Defined at line 335 of file ../../third_party/abseil-cpp/src/absl/strings/numbers.h
-
bool operator> (Duration lhs, Duration rhs)Defined at line 336 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator>= (Duration lhs, Duration rhs)Defined at line 340 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename int_type>bool SimpleHexAtoi (absl::string_view str, int_type * _Nonnull out)SimpleHexAtoi()
Converts a hexadecimal string (optionally followed or preceded by ASCII
whitespace) to an integer, returning `true` if successful. Only valid base-16
hexadecimal integers whose value falls within the range of the integer type
(optionally preceded by a `+` or `-`) can be converted. A valid hexadecimal
value may include both upper and lowercase character symbols, and may
optionally include a leading "0x" (or "0X") number prefix, which is ignored
by this function. If any errors are encountered, this function returns
`false`, leaving `out` in an unspecified state.
Defined at line 341 of file ../../third_party/abseil-cpp/src/absl/strings/numbers.h
-
template <typename C, typename T>container_algorithm_internal::ContainerDifferenceType<const C> c_count (const C & c, T && value)c_count()
Container-based version of the
<algorithm
> `std::count()` function to count
values that match within a container.
Defined at line 341 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
bool operator<= (Duration lhs, Duration rhs)Defined at line 344 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool SimpleHexAtoi (absl::string_view str, absl::int128 * _Nonnull out)Overloads of SimpleHexAtoi() for 128 bit integers.
Defined at line 346 of file ../../third_party/abseil-cpp/src/absl/strings/numbers.h
-
bool operator!= (Duration lhs, Duration rhs)Defined at line 350 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool SimpleHexAtoi (absl::string_view str, absl::uint128 * _Nonnull out)Defined at line 351 of file ../../third_party/abseil-cpp/src/absl/strings/numbers.h
-
void RemoveExtraAsciiWhitespace (std::string * _Nonnull str)Removes leading, trailing, and consecutive internal whitespace.
-
template <typename C, typename Pred>container_algorithm_internal::ContainerDifferenceType<const C> c_count_if (const C & c, Pred && pred)c_count_if()
Container-based version of the
<algorithm
> `std::count_if()` function to
count values matching a condition within a container.
Defined at line 354 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
Duration operator+ (Duration lhs, Duration rhs)Defined at line 357 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration operator- (Duration lhs, Duration rhs)Defined at line 361 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename... Args>std::string StrFormat (const FormatSpec<Args...> & format, const Args &... args)StrFormat()
Returns a `string` given a `printf()`-style format string and zero or more
additional arguments. Use it as you would `sprintf()`. `StrFormat()` is the
primary formatting function within the `str_format` library, and should be
used in most cases where you need type-safe conversion of types into
formatted strings.
The format string generally consists of ordinary character data along with
one or more format conversion specifiers (denoted by the `%` character).
Ordinary character data is returned unchanged into the result string, while
each conversion specification performs a type substitution from
`StrFormat()`'s other arguments. See the comments for `FormatSpec` for full
information on the makeup of this format string.
Example:
std::string s = absl::StrFormat(
"Welcome to %s, Number %d!", "The Village", 6);
EXPECT_EQ("Welcome to The Village, Number 6!", s);
Returns an empty string in case of error.
Defined at line 362 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
template <typename C1, typename C2>container_algorithm_internal::ContainerIterPairType<C1, C2> c_mismatch (C1 & c1, C2 & c2)c_mismatch()
Container-based version of the
<algorithm
> `std::mismatch()` function to
return the first element where two ordered containers differ. Applies `==` to
the first N elements of `c1` and `c2`, where N = min(size(c1), size(c2)).
Defined at line 368 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename... Args>std::string & StrAppendFormat (std::string * _Nonnulldst,const FormatSpec<Args...> &format,const Args &...args)StrAppendFormat()
Appends to a `dst` string given a format string, and zero or more additional
arguments, returning `*dst` as a convenience for chaining purposes. Appends
nothing in case of error (but possibly alters its capacity).
Example:
std::string orig("For example PI is approximately ");
std::cout
<
<
StrAppendFormat(
&orig
, "%12.6f", 3.14);
Defined at line 380 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
template <typename C1,typename C2,typename BinaryPredicate>container_algorithm_internal::ContainerIterPairType<C1, C2> c_mismatch (C1 &c1,C2 &c2,BinaryPredicatepred)Overload of c_mismatch() for using a predicate evaluation other than `==` as
the function's test condition. Applies `pred`to the first N elements of `c1`
and `c2`, where N = min(size(c1), size(c2)).
Defined at line 381 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C1, typename C2>bool c_equal (const C1 & c1, const C2 & c2)c_equal()
Container-based version of the
<algorithm
> `std::equal()` function to
test whether two containers are equal.
Defined at line 395 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename... Args>str_format_internal::Streamable StreamFormat (const FormatSpec<Args...> & format, const Args &... args)StreamFormat()
Writes to an output stream given a format string and zero or more arguments,
generally in a manner that is more efficient than streaming the result of
`absl::StrFormat()`. The returned object must be streamed before the full
expression ends.
Example:
std::cout
<
<
StreamFormat("%12.6f", 3.14);
Defined at line 399 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
template <typename C1,typename C2,typename BinaryPredicate>bool c_equal (const C1 &c1,const C2 &c2,BinaryPredicate &&pred)Overload of c_equal() for using a predicate evaluation other than `==` as
the function's test condition.
Defined at line 405 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T>Duration operator* (Duration lhs, T rhs)Multiplicative Operators
Integer operands must be representable as int64_t.
Defined at line 413 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename T>Duration operator* (T lhs, Duration rhs)Defined at line 417 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C1, typename C2>bool c_is_permutation (const C1 & c1, const C2 & c2)c_is_permutation()
Container-based version of the
<algorithm
> `std::is_permutation()` function
to test whether a container is a permutation of another.
Defined at line 419 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename... Args>int PrintF (const FormatSpec<Args...> & format, const Args &... args)PrintF()
Writes to stdout given a format string and zero or more arguments. This
function is functionally equivalent to `std::printf()` (and type-safe);
prefer `absl::PrintF()` over `std::printf()`.
Example:
std::string_view s = "Ulaanbaatar";
absl::PrintF("The capital of Mongolia is %s", s);
Outputs: "The capital of Mongolia is Ulaanbaatar"
Defined at line 420 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
template <typename T>Duration operator/ (Duration lhs, T rhs)Defined at line 421 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t operator/ (Duration lhs, Duration rhs)Defined at line 424 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration operator% (Duration lhs, Duration rhs)Defined at line 429 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C1,typename C2,typename BinaryPredicate>bool c_is_permutation (const C1 &c1,const C2 &c2,BinaryPredicate &&pred)Overload of c_is_permutation() for using a predicate evaluation other than
`==` as the function's test condition.
Defined at line 430 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
Duration ZeroDuration ()ZeroDuration()
Returns a zero-length duration. This function behaves just like the default
constructor, but the name helps make the semantics clear at call sites.
Defined at line 438 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename... Args>int FPrintF (std::FILE * _Nonnulloutput,const FormatSpec<Args...> &format,const Args &...args)FPrintF()
Writes to a file given a format string and zero or more arguments. This
function is functionally equivalent to `std::fprintf()` (and type-safe);
prefer `absl::FPrintF()` over `std::fprintf()`.
Example:
std::string_view s = "Ulaanbaatar";
absl::FPrintF(stdout, "The capital of Mongolia is %s", s);
Outputs: "The capital of Mongolia is Ulaanbaatar"
Defined at line 440 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
template <typename Sequence1, typename Sequence2>container_algorithm_internal::ContainerIter<Sequence1> c_search (Sequence1 & sequence, Sequence2 & subsequence)c_search()
Container-based version of the
<algorithm
> `std::search()` function to search
a container for a subsequence.
Defined at line 444 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
Duration AbsDuration (Duration d)AbsDuration()
Returns the absolute value of a duration.
Defined at line 445 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename Sequence1,typename Sequence2,typename BinaryPredicate>container_algorithm_internal::ContainerIter<Sequence1> c_search (Sequence1 &sequence,Sequence2 &subsequence,BinaryPredicate &&pred)Overload of c_search() for using a predicate evaluation other than
`==` as the function's test condition.
Defined at line 456 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
bool is_constant_evaluated ()Defined at line 464 of file ../../third_party/abseil-cpp/src/absl/meta/type_traits.h
-
template <typename Sink>void AbslStringify (Sink & sink, CivilSecond c)Support for StrFormat(), StrCat(), etc
Defined at line 467 of file ../../third_party/abseil-cpp/src/absl/time/civil_time.h
-
template <typename H>H AbslHashValue (H h, int128 v)Support for absl::Hash.
Defined at line 468 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
template <typename... Args>int SNPrintF (char * _Nonnulloutput,std::size_tsize,const FormatSpec<Args...> &format,const Args &...args)SNPrintF()
Writes to a sized buffer given a format string and zero or more arguments.
This function is functionally equivalent to `std::snprintf()` (and
type-safe); prefer `absl::SNPrintF()` over `std::snprintf()`.
In particular, a successful call to `absl::SNPrintF()` writes at most `size`
bytes of the formatted output to `output`, including a NUL-terminator, and
returns the number of bytes that would have been written if truncation did
not occur. In the event of an error, a negative value is returned and `errno`
is set.
Example:
std::string_view s = "Ulaanbaatar";
char output[128];
absl::SNPrintF(output, sizeof(output),
"The capital of Mongolia is %s", s);
Post-condition: output == "The capital of Mongolia is Ulaanbaatar"
Defined at line 469 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
template <typename Sink>void AbslStringify (Sink & sink, CivilMinute c)Defined at line 471 of file ../../third_party/abseil-cpp/src/absl/time/civil_time.h
-
template <typename Sequence1, typename Sequence2>bool c_contains_subrange (Sequence1 & sequence, Sequence2 & subsequence)c_contains_subrange()
Container-based version of the
<algorithm
> `std::ranges::contains_subrange()`
C++23 function to search a container for a subsequence.
Defined at line 472 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sink>void AbslStringify (Sink & sink, CivilHour c)Defined at line 475 of file ../../third_party/abseil-cpp/src/absl/time/civil_time.h
-
template <typename Sink>void AbslStringify (Sink & sink, int128 v)Support for absl::StrCat() etc.
Defined at line 478 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
template <typename Sink>void AbslStringify (Sink & sink, CivilDay c)Defined at line 479 of file ../../third_party/abseil-cpp/src/absl/time/civil_time.h
-
template <typename Sequence1,typename Sequence2,typename BinaryPredicate>bool c_contains_subrange (Sequence1 &sequence,Sequence2 &subsequence,BinaryPredicate &&pred)Overload of c_contains_subrange() for using a predicate evaluation other than
`==` as the function's test condition.
Defined at line 481 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sink>void AbslStringify (Sink & sink, CivilMonth c)Defined at line 483 of file ../../third_party/abseil-cpp/src/absl/time/civil_time.h
-
template <typename Sink>void AbslStringify (Sink & sink, CivilYear c)Defined at line 487 of file ../../third_party/abseil-cpp/src/absl/time/civil_time.h
-
template <typename Sequence,typename Size,typename T>container_algorithm_internal::ContainerIter<Sequence> c_search_n (Sequence &sequence,Sizecount,T &&value)c_search_n()
Container-based version of the
<algorithm
> `std::search_n()` function to
search a container for the first sequence of N elements.
Defined at line 493 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence,typename Size,typename T,typename BinaryPredicate>container_algorithm_internal::ContainerIter<Sequence> c_search_n (Sequence &sequence,Sizecount,T &&value,BinaryPredicate &&pred)Overload of c_search_n() for using a predicate evaluation other than
`==` as the function's test condition.
Defined at line 505 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename H>H AbslHashValue (H h, Span<T> v)Support for absl::Hash.
Defined at line 510 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename K,typename V,typename C,typename A>void swap (btree_map<K, V, C, A> & x, btree_map<K, V, C, A> & y)absl::swap(absl::btree_map
<
>, absl::btree_map
<
>)
Swaps the contents of two `absl::btree_map` containers.
Defined at line 524 of file ../../third_party/abseil-cpp/src/absl/container/btree_map.h
-
template <typename InputSequence, typename OutputIterator>OutputIterator c_copy (const InputSequence & input, OutputIterator output)c_copy()
Container-based version of the
<algorithm
> `std::copy()` function to copy a
container's elements into an iterator.
Defined at line 524 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename... Args>bool Format (FormatRawSinkraw_sink,const FormatSpec<Args...> &format,const Args &...args)Format()
Writes a formatted string to an arbitrary sink object (implementing the
`absl::FormatRawSink` interface), using a format string and zero or more
additional arguments.
By default, `std::string`, `std::ostream`, and `absl::Cord` are supported as
destination objects. If a `std::string` is used the formatted string is
appended to it.
`absl::Format()` is a generic version of `absl::StrAppendFormat()`, for
custom sinks. The format string, like format strings for `StrFormat()`, is
checked at compile-time.
On failure, this function returns `false` and the state of the sink is
unspecified.
Defined at line 528 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
template <typename Delimiter>strings_internal::Splitter<typename strings_internal::SelectDelimiter<Delimiter>::type, AllowEmpty, absl::string_view> StrSplit (strings_internal::ConvertibleToStringView text, Delimiter d)StrSplit()
Splits a given string based on the provided `Delimiter` object, returning the
elements within the type specified by the caller. Optionally, you may pass a
`Predicate` to `StrSplit()` indicating whether to include or exclude the
resulting element within the final result set. (See the overviews for
Delimiters and Predicates above.)
Example:
std::vector
<std
::string> v = absl::StrSplit("a,b,c,d", ',');
// v[0] == "a", v[1] == "b", v[2] == "c", v[3] == "d"
You can also provide an explicit `Delimiter` object:
Example:
using absl::ByAnyChar;
std::vector
<std
::string> v = absl::StrSplit("a,b=c", ByAnyChar(",="));
// v[0] == "a", v[1] == "b", v[2] == "c"
See above for more information on delimiters.
By default, empty strings are included in the result set. You can optionally
include a third `Predicate` argument to apply a test for whether the
resultant element should be included in the result set:
Example:
std::vector
<std
::string> v = absl::StrSplit(" a , ,,b,",
',', SkipWhitespace());
// v[0] == " a ", v[1] == "b"
See above for more information on predicates.
------------------------------------------------------------------------------
StrSplit() Return Types
------------------------------------------------------------------------------
The `StrSplit()` function adapts the returned collection to the collection
specified by the caller (e.g. `std::vector` above). The returned collections
may contain `std::string`, `absl::string_view` (in which case the original
string being split must ensure that it outlives the collection), or any
object that can be explicitly created from an `absl::string_view`. This
behavior works for:
1) All standard STL containers including `std::vector`, `std::list`,
`std::deque`, `std::set`,`std::multiset`, 'std::map`, and `std::multimap`.
2) `std::pair` (which is not actually a container). See below.
3) `std::array`, which is a container but has different behavior due to its
fixed size. See below.
Example:
// The results are returned as `absl::string_view` objects. Note that we
// have to ensure that the input string outlives any results.
std::vector
<absl
::string_view> v = absl::StrSplit("a,b,c", ',');
// Stores results in a std::set
<std
::string>, which also performs
// de-duplication and orders the elements in ascending order.
std::set
<std
::string> a = absl::StrSplit("b,a,c,a,b", ',');
// a[0] == "a", a[1] == "b", a[2] == "c"
// `StrSplit()` can be used within a range-based for loop, in which case
// each element will be of type `absl::string_view`.
std::vector
<std
::string> v;
for (const auto sv : absl::StrSplit("a,b,c", ',')) {
if (sv != "b") v.emplace_back(sv);
}
// v[0] == "a", v[1] == "c"
// Stores results in a map. The map implementation assumes that the input
// is provided as a series of key/value pairs. For example, the 0th element
// resulting from the split will be stored as a key to the 1st element. If
// an odd number of elements are resolved, the last element is paired with
// a default-constructed value (e.g., empty string).
std::map
<std
::string, std::string> m = absl::StrSplit("a,b,c", ',');
// m["a"] == "b", m["c"] == "" // last component value equals ""
Splitting to `std::pair` is an interesting case because it can hold only two
elements and is not a collection type. When splitting to a `std::pair` the
first two split strings become the `std::pair` `.first` and `.second`
members, respectively. The remaining split substrings are discarded. If there
are less than two split substrings, the empty string is used for the
corresponding `std::pair` member.
Example:
// Stores first two split strings as the members in a std::pair.
std::pair
<std
::string, std::string> p = absl::StrSplit("a,b,c", ',');
// p.first == "a", p.second == "b" // "c" is omitted.
Splitting to `std::array` is similar to splitting to `std::pair`, but for
N elements instead of two; missing elements are filled with the empty string
and extra elements are discarded.
Examples:
// Stores first two split strings as the elements in a std::array.
std::array
<std
::string, 2> a = absl::StrSplit("a,b,c", ',');
// a[0] == "a", a[1] == "b" // "c" is omitted.
// The second element is empty.
std::array
<std
::string, 2> a = absl::StrSplit("a,", ',');
// a[0] == "a", a[1] == ""
The `StrSplit()` function can be used multiple times to perform more
complicated splitting logic, such as intelligently parsing key-value pairs.
Example:
// The input string "a=b=c,d=e,f=,g" becomes
// { "a" => "b=c", "d" => "e", "f" => "", "g" => "" }
std::map
<std
::string, std::string> m;
for (absl::string_view sp : absl::StrSplit("a=b=c,d=e,f=,g", ',')) {
m.insert(absl::StrSplit(sp, absl::MaxSplits('=', 1)));
}
EXPECT_EQ("b=c", m.find("a")->second);
EXPECT_EQ("e", m.find("d")->second);
EXPECT_EQ("", m.find("f")->second);
EXPECT_EQ("", m.find("g")->second);
WARNING: Due to a legacy bug that is maintained for backward compatibility,
splitting the following empty string_views produces different results:
absl::StrSplit(absl::string_view(""), '-'); // {""}
absl::StrSplit(absl::string_view(), '-'); // {}, but should be {""}
Try not to depend on this distinction because the bug may one day be fixed.
Defined at line 531 of file ../../third_party/abseil-cpp/src/absl/strings/str_split.h
-
template <typename K,typename V,typename C,typename A,typename Pred>typename btree_map<K, V, C, A>::size_type erase_if (btree_map<K, V, C, A> & map, Pred pred)absl::erase_if(absl::btree_map
<
>, Pred)
Erases all elements that satisfy the predicate pred from the container.
Returns the number of erased elements.
Defined at line 533 of file ../../third_party/abseil-cpp/src/absl/container/btree_map.h
-
template <typename C,typename Size,typename OutputIterator>OutputIterator c_copy_n (const C &input,Sizen,OutputIteratoroutput)c_copy_n()
Container-based version of the
<algorithm
> `std::copy_n()` function to copy a
container's first N elements into an iterator.
Defined at line 535 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T, time_internal::EnableIfIntegral<T> = 0>Duration Nanoseconds (T n)Nanoseconds()
Microseconds()
Milliseconds()
Seconds()
Minutes()
Hours()
Factory functions for constructing `Duration` values from an integral number
of the unit indicated by the factory function's name. The number must be
representable as int64_t.
NOTE: no "Days()" factory function exists because "a day" is ambiguous.
Civil days are not always 24 hours long, and a 24-hour duration often does
not correspond with a civil day. If a 24-hour duration is needed, use
`absl::Hours(24)`. If you actually want a civil day, use absl::CivilDay
from civil_time.h.
Example:
absl::Duration a = absl::Seconds(60);
absl::Duration b = absl::Minutes(1); // b == a
Defined at line 539 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename T, time_internal::EnableIfIntegral<T> = 0>Duration Microseconds (T n)Defined at line 543 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename Delimiter,typename StringType,EnableSplitIfString<StringType> = 0>strings_internal::Splitter<typename strings_internal::SelectDelimiter<Delimiter>::type, AllowEmpty, std::string> StrSplit (StringType && text, Delimiter d)Defined at line 544 of file ../../third_party/abseil-cpp/src/absl/strings/str_split.h
-
template <typename InputSequence,typename OutputIterator,typename Pred>OutputIterator c_copy_if (const InputSequence &input,OutputIteratoroutput,Pred &&pred)c_copy_if()
Container-based version of the
<algorithm
> `std::copy_if()` function to copy
a container's elements satisfying some condition into an iterator.
Defined at line 545 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
std::string StrCat ()Defined at line 546 of file ../../third_party/abseil-cpp/src/absl/strings/str_cat.h
-
template <typename T, time_internal::EnableIfIntegral<T> = 0>Duration Milliseconds (T n)Defined at line 547 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename T>std::string StrCat (strings_internal::EnableIfFastCase<T> a)Defined at line 549 of file ../../third_party/abseil-cpp/src/absl/strings/str_cat.h
-
template <typename T, time_internal::EnableIfIntegral<T> = 0>Duration Seconds (T n)Defined at line 551 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
std::string StrCat (const AlphaNum & a)Defined at line 553 of file ../../third_party/abseil-cpp/src/absl/strings/str_cat.h
-
template <typename T, time_internal::EnableIfIntegral<T> = 0>Duration Minutes (T n)Defined at line 555 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename Delimiter, typename Predicate>strings_internal::Splitter<typename strings_internal::SelectDelimiter<Delimiter>::type, Predicate, absl::string_view> StrSplit (strings_internal::ConvertibleToStringViewtext,Delimiterd,Predicatep)Defined at line 555 of file ../../third_party/abseil-cpp/src/absl/strings/str_split.h
-
template <typename C, typename BidirectionalIterator>BidirectionalIterator c_copy_backward (const C & src, BidirectionalIterator dest)c_copy_backward()
Container-based version of the
<algorithm
> `std::copy_backward()` function to
copy a container's elements in reverse order into an iterator.
Defined at line 557 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T, time_internal::EnableIfIntegral<T> = 0>Duration Hours (T n)Defined at line 559 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C, typename OutputIterator>OutputIterator c_move (C && src, OutputIterator dest)c_move()
Container-based version of the
<algorithm
> `std::move()` function to move
a container's elements into an iterator.
Defined at line 568 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Delimiter,typename Predicate,typename StringType,EnableSplitIfString<StringType> = 0>strings_internal::Splitter<typename strings_internal::SelectDelimiter<Delimiter>::type, Predicate, std::string> StrSplit (StringType &&text,Delimiterd,Predicatep)Defined at line 569 of file ../../third_party/abseil-cpp/src/absl/strings/str_split.h
-
template <typename T, time_internal::EnableIfFloat<T> = 0>Duration Nanoseconds (T n)Factory overloads for constructing `Duration` values from a floating-point
number of the unit indicated by the factory function's name. These functions
exist for convenience, but they are not as efficient as the integral
factories, which should be preferred.
Example:
auto a = absl::Seconds(1.5); // OK
auto b = absl::Milliseconds(1500); // BETTER
Defined at line 573 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename T, time_internal::EnableIfFloat<T> = 0>Duration Microseconds (T n)Defined at line 577 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C, typename BidirectionalIterator>BidirectionalIterator c_move_backward (C && src, BidirectionalIterator dest)c_move_backward()
Container-based version of the
<algorithm
> `std::move_backward()` function to
move a container's elements into an iterator in reverse order.
Defined at line 579 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T, time_internal::EnableIfFloat<T> = 0>Duration Milliseconds (T n)Defined at line 581 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename K,typename V,typename H,typename E,typename A,typename Predicate>typename flat_hash_map<K, V, H, E, A>::size_type erase_if (flat_hash_map<K, V, H, E, A> & c, Predicate pred)erase_if(flat_hash_map
<
>, Pred)
Erases all elements that satisfy the predicate `pred` from the container `c`.
Returns the number of erased elements.
Defined at line 582 of file ../../third_party/abseil-cpp/src/absl/container/flat_hash_map.h
-
bool FormatUntyped (FormatRawSinkraw_sink,const UntypedFormatSpec &format,absl::Span<const FormatArg>args)FormatUntyped()
Writes a formatted string to an arbitrary sink object (implementing the
`absl::FormatRawSink` interface), using an `UntypedFormatSpec` and zero or
more additional arguments.
This function acts as the most generic formatting function in the
`str_format` library. The caller provides a raw sink, an unchecked format
string, and (usually) a runtime specified list of arguments; no compile-time
checking of formatting is performed within this function. As a result, a
caller should check the return value to verify that no error occurred.
On failure, this function returns `false` and the state of the sink is
unspecified.
The arguments are provided in an `absl::Span
<const
absl::FormatArg>`.
Each `absl::FormatArg` object binds to a single argument and keeps a
reference to it. The values used to create the `FormatArg` objects must
outlive this function call.
Example:
std::optional
<std
::string> FormatDynamic(
const std::string
&
in_format,
const vector
<std
::string>
&
in_args) {
std::string out;
std::vector
<absl
::FormatArg> args;
for (const auto
&
v : in_args) {
// It is important that 'v' is a reference to the objects in in_args.
// The values we pass to FormatArg must outlive the call to
// FormatUntyped.
args.emplace_back(v);
}
absl::UntypedFormatSpec format(in_format);
if (!absl::FormatUntyped(
&out
, format, args)) {
return std::nullopt;
}
return std::move(out);
}
Defined at line 585 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
template <typename T, time_internal::EnableIfFloat<T> = 0>Duration Seconds (T n)Defined at line 585 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C1, typename C2>container_algorithm_internal::ContainerIter<C2> c_swap_ranges (C1 & c1, C2 & c2)c_swap_ranges()
Container-based version of the
<algorithm
> `std::swap_ranges()` function to
swap a container's elements with another container's elements. Swaps the
first N elements of `c1` and `c2`, where N = min(size(c1), size(c2)).
Defined at line 591 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename K,typename V,typename H,typename E,typename A>void swap (flat_hash_map<K, V, H, E, A> & x, flat_hash_map<K, V, H, E, A> & y)swap(flat_hash_map
<
>, flat_hash_map
<
>)
Swaps the contents of two `flat_hash_map` containers.
NOTE: we need to define this function template in order for
`flat_hash_set::swap` to be called instead of `std::swap`. Even though we
have `swap(raw_hash_set
&
, raw_hash_set
&
)` defined, that function requires a
derived-to-base conversion, whereas `std::swap` is a function template so
`std::swap` will be preferred by compiler.
Defined at line 597 of file ../../third_party/abseil-cpp/src/absl/container/flat_hash_map.h
-
void StrAppend (std::string * _Nonnull )-----------------------------------------------------------------------------
StrAppend()
-----------------------------------------------------------------------------
Appends a string or set of strings to an existing string, in a similar
fashion to `StrCat()`.
WARNING: `StrAppend(
&str
, a, b, c, ...)` requires that none of the
a, b, c, parameters be a reference into str. For speed, `StrAppend()` does
not try to check each of its input arguments to be sure that they are not
a subset of the string being appended to. That is, while this will work:
std::string s = "foo";
s += s;
This output is undefined:
std::string s = "foo";
StrAppend(
&s
, s);
This output is undefined as well, since `absl::string_view` does not own its
data:
std::string s = "foobar";
absl::string_view p = s;
StrAppend(
&s
, p);
Defined at line 600 of file ../../third_party/abseil-cpp/src/absl/strings/str_cat.h
-
template <typename T, time_internal::EnableIfFloat<T> = 0>Duration Minutes (T n)Defined at line 600 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename T, time_internal::EnableIfFloat<T> = 0>Duration Hours (T n)Defined at line 604 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename InputSequence,typename OutputIterator,typename UnaryOp>OutputIterator c_transform (const InputSequence &input,OutputIteratoroutput,UnaryOp &&unary_op)c_transform()
Container-based version of the
<algorithm
> `std::transform()` function to
transform a container's elements using the unary operation, storing the
result in an iterator pointing to the last transformed element in the output
range.
Defined at line 613 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename InputSequence1,typename InputSequence2,typename OutputIterator,typename BinaryOp>OutputIterator c_transform (const InputSequence1 &input1,const InputSequence2 &input2,OutputIteratoroutput,BinaryOp &&binary_op)Overload of c_transform() for performing a transformation using a binary
predicate. Applies `binary_op` to the first N elements of `c1` and `c2`,
where N = min(size(c1), size(c2)).
Defined at line 625 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence, typename T>void c_replace (Sequence &sequence,const T &old_value,const T &new_value)c_replace()
Container-based version of the
<algorithm
> `std::replace()` function to
replace a container's elements of some value with a new value. The container
is modified in place.
Defined at line 646 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C,typename Pred,typename T>void c_replace_if (C &c,Pred &&pred,T &&new_value)c_replace_if()
Container-based version of the
<algorithm
> `std::replace_if()` function to
replace a container's elements of some value with a new value based on some
condition. The container is modified in place.
Defined at line 660 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
uint64_t Uint128Low64 (uint128 v)Uint128Low64()
Returns the lower 64-bit value of a `uint128` value.
Defined at line 661 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
uint64_t Uint128High64 (uint128 v)Uint128High64()
Returns the higher 64-bit value of a `uint128` value.
Defined at line 663 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
uint128 MakeUint128 (uint64_t high, uint64_t low)MakeUInt128()
Constructs a `uint128` numeric value from two 64-bit unsigned integers.
Note that this factory function is the only way to construct a `uint128`
from integer values greater than 2^64.
Example:
absl::uint128 big = absl::MakeUint128(1, 0);
Defined at line 571 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
uint128 Uint128Max ()Uint128Max()
Returns the highest value for a 128-bit unsigned integer.
Defined at line 257 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
template <typename C,typename OutputIterator,typename T>OutputIterator c_replace_copy (const C &c,OutputIteratorresult,T &&old_value,T &&new_value)c_replace_copy()
Container-based version of the
<algorithm
> `std::replace_copy()` function to
replace a container's elements of some value with a new value and return the
results within an iterator.
Defined at line 673 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C,typename OutputIterator,typename Pred,typename T>OutputIterator c_replace_copy_if (const C &c,OutputIteratorresult,Pred &&pred,const T &new_value)c_replace_copy_if()
Container-based version of the
<algorithm
> `std::replace_copy_if()` function
to replace a container's elements of some value with a new value based on
some condition, and return the results within an iterator.
Defined at line 687 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C, typename T>void c_fill (C & c, const T & value)c_fill()
Container-based version of the
<algorithm
> `std::fill()` function to fill a
container with some value.
Defined at line 699 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C,typename Size,typename T>void c_fill_n (C &c,Sizen,const T &value)c_fill_n()
Container-based version of the
<algorithm
> `std::fill_n()` function to fill
the first N elements in a container with some value.
Defined at line 709 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sink>void AbslStringify (Sink & sink, Duration d)Support for StrFormat(), StrCat() etc.
Defined at line 715 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C, typename Generator>void c_generate (C & c, Generator && gen)c_generate()
Container-based version of the
<algorithm
> `std::generate()` function to
assign a container's elements to the values provided by the given generator.
Defined at line 719 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C,typename Size,typename Generator>container_algorithm_internal::ContainerIter<C> c_generate_n (C &c,Sizen,Generator &&gen)c_generate_n()
Container-based version of the
<algorithm
> `std::generate_n()` function to
assign a container's first N elements to the values provided by the given
generator.
Defined at line 731 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C,typename OutputIterator,typename T>OutputIterator c_remove_copy (const C &c,OutputIteratorresult,const T &value)c_remove_copy()
Container-based version of the
<algorithm
> `std::remove_copy()` function to
copy a container's elements while removing any elements matching the given
`value`.
Defined at line 749 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C,typename OutputIterator,typename Pred>OutputIterator c_remove_copy_if (const C &c,OutputIteratorresult,Pred &&pred)c_remove_copy_if()
Container-based version of the
<algorithm
> `std::remove_copy_if()` function
to copy a container's elements while removing any elements matching the given
condition.
Defined at line 762 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C, typename OutputIterator>OutputIterator c_unique_copy (const C & c, OutputIterator result)c_unique_copy()
Container-based version of the
<algorithm
> `std::unique_copy()` function to
copy a container's elements while removing any elements containing duplicate
values.
Defined at line 775 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C,typename OutputIterator,typename BinaryPredicate>OutputIterator c_unique_copy (const C &c,OutputIteratorresult,BinaryPredicate &&pred)Overload of c_unique_copy() for using a predicate evaluation other than
`==` for comparing uniqueness of the element values.
Defined at line 784 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence>void c_reverse (Sequence & sequence)c_reverse()
Container-based version of the
<algorithm
> `std::reverse()` function to
reverse a container's elements.
Defined at line 796 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C, typename OutputIterator>OutputIterator c_reverse_copy (const C & sequence, OutputIterator result)c_reverse_copy()
Container-based version of the
<algorithm
> `std::reverse()` function to
reverse a container's elements and write them to an iterator range.
Defined at line 806 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C, typename Iterator = container_algorithm_internal::ContainerIter<C>>Iterator c_rotate (C & sequence, Iterator middle)c_rotate()
Container-based version of the
<algorithm
> `std::rotate()` function to
shift a container's elements leftward such that the `middle` element becomes
the first element in the container.
Defined at line 820 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
bool operator!= (uint128 lhs, uint128 rhs)Defined at line 830 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
template <typename C, typename OutputIterator>OutputIterator c_rotate_copy (const C &sequence,container_algorithm_internal::ContainerIter<const C>middle,OutputIteratorresult)c_rotate_copy()
Container-based version of the
<algorithm
> `std::rotate_copy()` function to
shift a container's elements leftward such that the `middle` element becomes
the first element in a new iterator range.
Defined at line 832 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
bool operator< (uint128 lhs, uint128 rhs)Defined at line 832 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
template <typename RandomAccessContainer, typename UniformRandomBitGenerator>void c_shuffle (RandomAccessContainer & c, UniformRandomBitGenerator && gen)c_shuffle()
Container-based version of the
<algorithm
> `std::shuffle()` function to
randomly shuffle elements within the container using a `gen()` uniform random
number generator.
Defined at line 847 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename H>H AbslHashValue (H h, Time t)Defined at line 860 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C,typename OutputIterator,typename Distance,typename UniformRandomBitGenerator>OutputIterator c_sample (const C &c,OutputIteratorresult,Distancen,UniformRandomBitGenerator &&gen)c_sample()
Container-based version of the
<algorithm
> `std::sample()` function to
randomly sample elements from the container without replacement using a
`gen()` uniform random number generator and write them to an iterator range.
Defined at line 860 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
std::ostream & operator<< (std::ostream & os, absl::LogSeverity s)operator
<
<
The exact representation of a streamed `absl::LogSeverity` is deliberately
unspecified; do not rely on it.
-
std::ostream & operator<< (std::ostream & os, absl::LogSeverityAtLeast s) -
std::ostream & operator<< (std::ostream & os, absl::LogSeverityAtMost s) -
std::ostream & operator<< (std::ostream & os, uint128 v)allow uint128 to be logged
-
std::ostream & operator<< (std::ostream & os, StatusCode code)operator
<
<
Streams StatusCodeToString(code) to `os`.
-
std::strong_ordering operator<=> (Duration lhs, Duration rhs)Defined at line 1771 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator< (Duration lhs, Duration rhs)Defined at line 1759 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator== (Duration lhs, Duration rhs)Defined at line 1787 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration operator- (Duration d)Additive Operators
Defined at line 1793 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
uint64_t Int128Low64 (int128 v)Int128Low64()
Returns the lower 64-bit value of a `int128` value.
Defined at line 42 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
int64_t Int128High64 (int128 v)Int128High64()
Returns the higher 64-bit value of a `int128` value.
Defined at line 46 of file ../../third_party/abseil-cpp/src/absl/numeric/int128_have_intrinsic.inc
-
Duration Trunc (Duration d, Duration unit)Trunc()
Truncates a duration (toward zero) to a multiple of a non-zero unit.
Example:
absl::Duration d = absl::Nanoseconds(123456789);
absl::Duration a = absl::Trunc(d, absl::Microseconds(1)); // 123456us
-
std::string FormatCivilTime (CivilSecond c)FormatCivilTime()
Formats the given civil-time value into a string value of the following
format:
Type | Format
---------------------------------
CivilSecond | YYYY-MM-DDTHH:MM:SS
CivilMinute | YYYY-MM-DDTHH:MM
CivilHour | YYYY-MM-DDTHH
CivilDay | YYYY-MM-DD
CivilMonth | YYYY-MM
CivilYear | YYYY
Example:
absl::CivilDay d = absl::CivilDay(1969, 7, 20);
std::string day_string = absl::FormatCivilTime(d); // "1969-07-20"
-
std::string FormatCivilTime (CivilMinute c) -
std::string FormatCivilTime (CivilHour c) -
std::string FormatCivilTime (CivilDay c) -
std::string FormatCivilTime (CivilMonth c) -
std::string FormatCivilTime (CivilYear c) -
Duration Floor (Duration d, Duration unit)Floor()
Floors a duration using the passed duration unit to its largest value not
greater than the duration.
Example:
absl::Duration d = absl::Nanoseconds(123456789);
absl::Duration b = absl::Floor(d, absl::Microseconds(1)); // 123456us
-
std::string StrCat (const AlphaNum & a, const AlphaNum & b) -
std::string StrCat (const AlphaNum &a,const AlphaNum &b,const AlphaNum &c) -
std::string StrCat (const AlphaNum &a,const AlphaNum &b,const AlphaNum &c,const AlphaNum &d) -
void StrAppend (std::string * _Nonnull dest, const AlphaNum & a) -
void StrAppend (std::string * _Nonnulldest,const AlphaNum &a,const AlphaNum &b) -
void StrAppend (std::string * _Nonnulldest,const AlphaNum &a,const AlphaNum &b,const AlphaNum &c) -
void StrAppend (std::string * _Nonnulldest,const AlphaNum &a,const AlphaNum &b,const AlphaNum &c,const AlphaNum &d) -
strings_internal::StreamFormatterImpl StreamFormatter ()StreamFormatter()
Formats its argument using the
<
<
operator.
Defined at line 103 of file ../../third_party/abseil-cpp/src/absl/strings/str_join.h
-
bool operator> (absl::LogSeverityAtLeast lhs, absl::LogSeverity rhs)Defined at line 176 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
bool operator<= (absl::LogSeverityAtLeast lhs, absl::LogSeverity rhs)Defined at line 177 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
bool operator>= (absl::LogSeverity lhs, absl::LogSeverityAtLeast rhs)Defined at line 177 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
bool operator< (absl::LogSeverityAtMost lhs, absl::LogSeverity rhs)Defined at line 178 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
bool operator> (absl::LogSeverity lhs, absl::LogSeverityAtMost rhs)Defined at line 178 of file ../../third_party/abseil-cpp/src/absl/base/log_severity.h
-
StatusToStringMode operator| (StatusToStringMode lhs, StatusToStringMode rhs)Defined at line 321 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
StatusToStringMode operator^ (StatusToStringMode lhs, StatusToStringMode rhs)Defined at line 326 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
StatusToStringMode operator~ (StatusToStringMode arg)Defined at line 331 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
StatusToStringMode & operator&= (StatusToStringMode & lhs, StatusToStringMode rhs)Defined at line 334 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
StatusToStringMode & operator|= (StatusToStringMode & lhs, StatusToStringMode rhs)Defined at line 339 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
StatusToStringMode & operator^= (StatusToStringMode & lhs, StatusToStringMode rhs)Defined at line 344 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
void swap (Cord & x, Cord & y)swap()
Swaps the contents of two Cords.
Defined at line 357 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator== (const FixedArray<T, N, A> & lhs, const FixedArray<T, N, A> & rhs)Relational operators. Equality operators are elementwise using
`operator==`, while order operators order FixedArrays lexicographically.
Defined at line 366 of file ../../third_party/abseil-cpp/src/absl/container/fixed_array.h
-
bool operator!= (const FixedArray<T, N, A> & lhs, const FixedArray<T, N, A> & rhs)Defined at line 370 of file ../../third_party/abseil-cpp/src/absl/container/fixed_array.h
-
bool operator< (const FixedArray<T, N, A> & lhs, const FixedArray<T, N, A> & rhs)Defined at line 374 of file ../../third_party/abseil-cpp/src/absl/container/fixed_array.h
-
bool operator> (const FixedArray<T, N, A> & lhs, const FixedArray<T, N, A> & rhs)Defined at line 379 of file ../../third_party/abseil-cpp/src/absl/container/fixed_array.h
-
bool operator<= (const FixedArray<T, N, A> & lhs, const FixedArray<T, N, A> & rhs)Defined at line 383 of file ../../third_party/abseil-cpp/src/absl/container/fixed_array.h
-
Weekday GetWeekday (CivilSecond cs)GetWeekday()
Returns the absl::Weekday for the given (realigned) civil-time value.
Example:
absl::CivilDay a(2015, 8, 13);
absl::Weekday wd = absl::GetWeekday(a); // wd == absl::Weekday::thursday
Defined at line 383 of file ../../third_party/abseil-cpp/src/absl/time/civil_time.h
-
bool operator>= (const FixedArray<T, N, A> & lhs, const FixedArray<T, N, A> & rhs)Defined at line 387 of file ../../third_party/abseil-cpp/src/absl/container/fixed_array.h
-
template <typename H>H AbslHashValue (H h, const FixedArray<T, N, A> & v)Defined at line 392 of file ../../third_party/abseil-cpp/src/absl/container/fixed_array.h
-
CivilDay NextWeekday (CivilDay cd, Weekday wd)NextWeekday()
PrevWeekday()
Returns the absl::CivilDay that strictly follows or precedes a given
absl::CivilDay, and that falls on the given absl::Weekday.
Example, given the following month:
August 2015
Su Mo Tu We Th Fr Sa
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
absl::CivilDay a(2015, 8, 13);
// absl::GetWeekday(a) == absl::Weekday::thursday
absl::CivilDay b = absl::NextWeekday(a, absl::Weekday::thursday);
// b = 2015-08-20
absl::CivilDay c = absl::PrevWeekday(a, absl::Weekday::thursday);
// c = 2015-08-06
absl::CivilDay d = ...
// Gets the following Thursday if d is not already Thursday
absl::CivilDay thurs1 = absl::NextWeekday(d - 1, absl::Weekday::thursday);
// Gets the previous Thursday if d is not already Thursday
absl::CivilDay thurs2 = absl::PrevWeekday(d + 1, absl::Weekday::thursday);
Defined at line 417 of file ../../third_party/abseil-cpp/src/absl/time/civil_time.h
-
bool ParseCivilTime (absl::string_view s, CivilSecond * c)absl::ParseCivilTime()
Parses a civil-time value from the specified `absl::string_view` into the
passed output parameter. Returns `true` upon successful parsing.
The expected form of the input string is as follows:
Type | Format
---------------------------------
CivilSecond | YYYY-MM-DDTHH:MM:SS
CivilMinute | YYYY-MM-DDTHH:MM
CivilHour | YYYY-MM-DDTHH
CivilDay | YYYY-MM-DD
CivilMonth | YYYY-MM
CivilYear | YYYY
Example:
absl::CivilDay d;
bool ok = absl::ParseCivilTime("2018-01-02",
&d
); // OK
Note that parsing will fail if the string's format does not match the
expected type exactly. `ParseLenientCivilTime()` below is more lenient.
-
template <typename... AV>std::string StrCat (const AlphaNum &a,const AlphaNum &b,const AlphaNum &c,const AlphaNum &d,const AlphaNum &e,const AV &...args)Support 5 or more arguments
Defined at line 565 of file ../../third_party/abseil-cpp/src/absl/strings/str_cat.h
-
template <typename... AV>void StrAppend (std::string * _Nonnulldest,const AlphaNum &a,const AlphaNum &b,const AlphaNum &c,const AlphaNum &d,const AlphaNum &e,const AV &...args)Support 5 or more arguments
Defined at line 611 of file ../../third_party/abseil-cpp/src/absl/strings/str_cat.h
-
strings_internal::AlphaNumBuffer<numbers_internal::kSixDigitsToBufferSize> SixDigits (double d)Helper function for the future StrCat default floating-point format, %.6g
This is fast.
Defined at line 621 of file ../../third_party/abseil-cpp/src/absl/strings/str_cat.h
-
template <typename T, std::enable_if_t<internal_statusor::IsEqualityComparable<T>::value, int> = 0>bool operator== (const StatusOr<T> & lhs, const StatusOr<T> & rhs)operator==()
This operator checks the equality of two `absl::StatusOr
<T
>` objects.
Defined at line 638 of file ../../third_party/abseil-cpp/src/absl/status/statusor.h
-
template <typename T, std::enable_if_t<internal_statusor::IsEqualityComparable<T>::value, int> = 0>bool operator!= (const StatusOr<T> & lhs, const StatusOr<T> & rhs)operator!=()
This operator checks the inequality of two `absl::StatusOr
<T
>` objects.
Defined at line 649 of file ../../third_party/abseil-cpp/src/absl/status/statusor.h
-
template <typename T, typename std::enable_if< absl::HasOstreamOperator<T>::value, int>::type = 0>std::ostream & operator<< (std::ostream & os, const StatusOr<T> & status_or)Prints the `value` or the status in brackets to `os`.
Requires `T` supports `operator
<
<
`. Do not rely on the output format which
may change without notice.
Defined at line 659 of file ../../third_party/abseil-cpp/src/absl/status/statusor.h
-
template <typename Sink,typename T,typename std::enable_if<absl::HasAbslStringify<T>::value, int>::type = 0>void AbslStringify (Sink & sink, const StatusOr<T> & status_or)As above, but supports `StrCat`, `StrFormat`, etc.
Requires `T` has `AbslStringify`. Do not rely on the output format which
may change without notice.
Defined at line 677 of file ../../third_party/abseil-cpp/src/absl/status/statusor.h
-
FormatConversionCharSet operator| (FormatConversionCharSet a, FormatConversionCharSet b)Type safe OR operator for FormatConversionCharSet to allow accepting multiple
conversion chars in custom format converters.
Defined at line 785 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
bool operator== (const Status & , const Status & )Defined at line 841 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
bool operator> (uint128 lhs, uint128 rhs)Defined at line 843 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
bool operator<= (uint128 lhs, uint128 rhs)Defined at line 845 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
bool operator>= (uint128 lhs, uint128 rhs)Defined at line 847 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
bool operator!= (const Status & , const Status & )Defined at line 848 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
absl::strong_ordering operator<=> (uint128 lhs, uint128 rhs)Defined at line 850 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
void swap (Status & a, Status & b)swap()
Swap the contents of one status with another.
Defined at line 860 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
void AbslFormatFlush (FormatSink * _Nonnull sink, absl::string_view v)Support `absl::Format(
&sink
, format, args...)`.
Defined at line 860 of file ../../third_party/abseil-cpp/src/absl/strings/str_format.h
-
template <typename K,typename V,typename C,typename A>void swap (btree_multimap<K, V, C, A> & x, btree_multimap<K, V, C, A> & y)absl::swap(absl::btree_multimap
<
>, absl::btree_multimap
<
>)
Swaps the contents of two `absl::btree_multimap` containers.
Defined at line 866 of file ../../third_party/abseil-cpp/src/absl/container/btree_map.h
-
std::strong_ordering operator<=> (const Cord & x, const Cord & y)Defined at line 873 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
template <typename K,typename V,typename C,typename A,typename Pred>typename btree_multimap<K, V, C, A>::size_type erase_if (btree_multimap<K, V, C, A> & map, Pred pred)absl::erase_if(absl::btree_multimap
<
>, Pred)
Erases all elements that satisfy the predicate pred from the container.
Returns the number of erased elements.
Defined at line 875 of file ../../third_party/abseil-cpp/src/absl/container/btree_map.h
-
std::strong_ordering operator<=> (const Cord & lhs, absl::string_view rhs)Defined at line 877 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
template <typename C, typename Pred>bool c_is_partitioned (const C & c, Pred && pred)c_is_partitioned()
Container-based version of the
<algorithm
> `std::is_partitioned()` function
to test whether all elements in the container for which `pred` returns `true`
precede those for which `pred` is `false`.
Defined at line 877 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
uint128 operator+ (uint128 val)Unary operators.
Defined at line 881 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
std::strong_ordering operator<=> (absl::string_view lhs, const Cord & rhs)Defined at line 882 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
int128 operator+ (int128 val)Defined at line 883 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
uint128 operator- (uint128 val)Defined at line 885 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
template <typename C, typename Pred>container_algorithm_internal::ContainerIter<C> c_partition (C & c, Pred && pred)c_partition()
Container-based version of the
<algorithm
> `std::partition()` function
to rearrange all elements in a container in such a way that all elements for
which `pred` returns `true` precede all those for which it returns `false`,
returning an iterator to the first element of the second group.
Defined at line 891 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
bool operator> (Time lhs, Time rhs)Defined at line 895 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator! (uint128 val)Defined at line 895 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
bool operator>= (Time lhs, Time rhs)Defined at line 898 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator<= (Time lhs, Time rhs)Defined at line 901 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
uint128 operator~ (uint128 val)Logical operators.
Defined at line 905 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
bool operator!= (Time lhs, Time rhs)Defined at line 907 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C, typename Pred>container_algorithm_internal::ContainerIter<C> c_stable_partition (C & c, Pred && pred)c_stable_partition()
Container-based version of the
<algorithm
> `std::stable_partition()` function
to rearrange all elements in a container in such a way that all elements for
which `pred` returns `true` precede all those for which it returns `false`,
preserving the relative ordering between the two groups. The function returns
an iterator to the first element of the second group.
Defined at line 907 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
Time operator+ (Time lhs, Duration rhs)Additive Operators
Defined at line 912 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
uint128 operator| (uint128 lhs, uint128 rhs)Defined at line 913 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
Time operator+ (Duration lhs, Time rhs)Defined at line 915 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Time operator- (Time lhs, Duration rhs)Defined at line 918 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C,typename OutputIterator1,typename OutputIterator2,typename Pred>std::pair<OutputIterator1, OutputIterator2> c_partition_copy (const C &c,OutputIterator1out_true,OutputIterator2out_false,Pred &&pred)c_partition_copy()
Container-based version of the
<algorithm
> `std::partition_copy()` function
to partition a container's elements and return them into two iterators: one
for which `pred` returns `true`, and one for which `pred` returns `false.`
Defined at line 922 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
uint128 operator& (uint128 lhs, uint128 rhs)Defined at line 923 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
Time UnixEpoch ()UnixEpoch()
Returns the `absl::Time` representing "1970-01-01 00:00:00.0 +0000".
Defined at line 928 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
uint128 operator^ (uint128 lhs, uint128 rhs)Defined at line 933 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
template <typename T,size_t N,typename A>void swap (absl::InlinedVector<T, N, A> & a, absl::InlinedVector<T, N, A> & b)`swap(...)`
Swaps the contents of two inlined vectors.
Defined at line 935 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
-
template <typename C, typename Pred>container_algorithm_internal::ContainerIter<C> c_partition_point (C & c, Pred && pred)c_partition_point()
Container-based version of the
<algorithm
> `std::partition_point()` function
to return the first element of an already partitioned container for which
the given `pred` is not `true`.
Defined at line 936 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T,size_t N,typename A>bool operator== (const absl::InlinedVector<T, N, A> & a, const absl::InlinedVector<T, N, A> & b)`operator==(...)`
Tests for value-equality of two inlined vectors.
Defined at line 944 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
-
template <typename C>void c_sort (C & c)c_sort()
Container-based version of the
<algorithm
> `std::sort()` function
to sort elements in ascending order of their values.
Defined at line 953 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T,size_t N,typename A>bool operator!= (const absl::InlinedVector<T, N, A> & a, const absl::InlinedVector<T, N, A> & b)`operator!=(...)`
Tests for value-inequality of two inlined vectors.
Defined at line 955 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
-
template <typename C, typename LessThan>void c_sort (C & c, LessThan && comp)Overload of c_sort() for performing a `comp` comparison other than the
default `operator
<
`.
Defined at line 961 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T,size_t N,typename A>bool operator< (const absl::InlinedVector<T, N, A> & a, const absl::InlinedVector<T, N, A> & b)`operator
<
(...)`
Tests whether the value of an inlined vector is less than the value of
another inlined vector using a lexicographical comparison algorithm.
Defined at line 965 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
-
template <typename C>void c_stable_sort (C & c)c_stable_sort()
Container-based version of the
<algorithm
> `std::stable_sort()` function
to sort elements in ascending order of their values, preserving the order
of equivalents.
Defined at line 973 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T,size_t N,typename A>bool operator> (const absl::InlinedVector<T, N, A> & a, const absl::InlinedVector<T, N, A> & b)`operator>(...)`
Tests whether the value of an inlined vector is greater than the value of
another inlined vector using a lexicographical comparison algorithm.
Defined at line 978 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
-
template <typename C, typename LessThan>void c_stable_sort (C & c, LessThan && comp)Overload of c_stable_sort() for performing a `comp` comparison other than the
default `operator
<
`.
Defined at line 981 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T,size_t N,typename A>bool operator<= (const absl::InlinedVector<T, N, A> & a, const absl::InlinedVector<T, N, A> & b)`operator
<
=(...)`
Tests whether the value of an inlined vector is less than or equal to the
value of another inlined vector using a lexicographical comparison algorithm.
Defined at line 988 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
-
template <typename C>bool c_is_sorted (const C & c)c_is_sorted()
Container-based version of the
<algorithm
> `std::is_sorted()` function
to evaluate whether the given container is sorted in ascending order.
Defined at line 992 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T,size_t N,typename A>bool operator>= (const absl::InlinedVector<T, N, A> & a, const absl::InlinedVector<T, N, A> & b)`operator>=(...)`
Tests whether the value of an inlined vector is greater than or equal to the
value of another inlined vector using a lexicographical comparison algorithm.
Defined at line 998 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
-
template <typename C, typename LessThan>bool c_is_sorted (const C & c, LessThan && comp)c_is_sorted() overload for performing a `comp` comparison other than the
default `operator
<
`.
Defined at line 1000 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename H,typename T,size_t N,typename A>H AbslHashValue (H h, const absl::InlinedVector<T, N, A> & a)`AbslHashValue(...)`
Provides `absl::Hash` support for `absl::InlinedVector`. It is uncommon to
call this directly.
Defined at line 1008 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
-
template <typename RandomAccessContainer>void c_partial_sort (RandomAccessContainer & sequence, container_algorithm_internal::ContainerIter<RandomAccessContainer> middle)c_partial_sort()
Container-based version of the
<algorithm
> `std::partial_sort()` function
to rearrange elements within a container such that elements before `middle`
are sorted in ascending order.
Defined at line 1013 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename T,size_t N,typename A,typename Predicate>typename InlinedVector<T, N, A>::size_type erase_if (InlinedVector<T, N, A> & v, Predicate pred)Defined at line 1013 of file ../../third_party/abseil-cpp/src/absl/container/inlined_vector.h
-
template <typename RandomAccessContainer, typename LessThan>void c_partial_sort (RandomAccessContainer &sequence,container_algorithm_internal::ContainerIter<RandomAccessContainer>middle,LessThan &&comp)Overload of c_partial_sort() for performing a `comp` comparison other than
the default `operator
<
`.
Defined at line 1023 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C, typename RandomAccessContainer>container_algorithm_internal::ContainerIter<RandomAccessContainer> c_partial_sort_copy (const C & sequence, RandomAccessContainer & result)c_partial_sort_copy()
Container-based version of the
<algorithm
> `std::partial_sort_copy()`
function to sort the elements in the given range `result` within the larger
`sequence` in ascending order (and using `result` as the output parameter).
At most min(result.last - result.first, sequence.last - sequence.first)
elements from the sequence will be stored in the result.
Defined at line 1040 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C,typename RandomAccessContainer,typename LessThan>container_algorithm_internal::ContainerIter<RandomAccessContainer> c_partial_sort_copy (const C &sequence,RandomAccessContainer &result,LessThan &&comp)Overload of c_partial_sort_copy() for performing a `comp` comparison other
than the default `operator
<
`.
Defined at line 1052 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C>container_algorithm_internal::ContainerIter<C> c_is_sorted_until (C & c)c_is_sorted_until()
Container-based version of the
<algorithm
> `std::is_sorted_until()` function
to return the first element within a container that is not sorted in
ascending order as an iterator.
Defined at line 1069 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C, typename LessThan>container_algorithm_internal::ContainerIter<C> c_is_sorted_until (C & c, LessThan && comp)Overload of c_is_sorted_until() for performing a `comp` comparison other than
the default `operator
<
`.
Defined at line 1079 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer>void c_nth_element (RandomAccessContainer & sequence, container_algorithm_internal::ContainerIter<RandomAccessContainer> nth)c_nth_element()
Container-based version of the
<algorithm
> `std::nth_element()` function
to rearrange the elements within a container such that the `nth` element
would be in that position in an ordered sequence; other elements may be in
any order, except that all preceding `nth` will be less than that element,
and all following `nth` will be greater than that element.
Defined at line 1095 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
int128 MakeInt128 (int64_t high, uint64_t low)MakeInt128()
Constructs a `int128` numeric value from two 64-bit integers. Note that
signedness is conveyed in the upper `high` value.
(absl::int128(1)
<
<
64) * high + low
Note that this factory function is the only way to construct a `int128`
from integer values greater than 2^64 or less than -2^64.
Example:
absl::int128 big = absl::MakeInt128(1, 0);
absl::int128 big_n = absl::MakeInt128(-1, 0);
Defined at line 1101 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
int128 Int128Max ()Int128Max()
Returns the maximum value for a 128-bit signed integer.
Defined at line 506 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
int128 Int128Min ()Int128Min()
Returns the minimum value for a 128-bit signed integer.
Defined at line 511 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
template <typename RandomAccessContainer, typename LessThan>void c_nth_element (RandomAccessContainer &sequence,container_algorithm_internal::ContainerIter<RandomAccessContainer>nth,LessThan &&comp)Overload of c_nth_element() for performing a `comp` comparison other than
the default `operator
<
`.
Defined at line 1105 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence, typename T>container_algorithm_internal::ContainerIter<Sequence> c_lower_bound (Sequence & sequence, const T & value)c_lower_bound()
Container-based version of the
<algorithm
> `std::lower_bound()` function
to return an iterator pointing to the first element in a sorted container
which does not compare less than `value`.
Defined at line 1124 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence,typename T,typename LessThan>container_algorithm_internal::ContainerIter<Sequence> c_lower_bound (Sequence &sequence,const T &value,LessThan &&comp)Overload of c_lower_bound() for performing a `comp` comparison other than
the default `operator
<
`.
Defined at line 1134 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence, typename T>container_algorithm_internal::ContainerIter<Sequence> c_upper_bound (Sequence & sequence, const T & value)c_upper_bound()
Container-based version of the
<algorithm
> `std::upper_bound()` function
to return an iterator pointing to the first element in a sorted container
which is greater than `value`.
Defined at line 1148 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Releaser>Cord MakeCordFromExternal (absl::string_view , Releaser && )MakeCordFromExternal()
Creates a Cord that takes ownership of external string memory. The
contents of `data` are not copied to the Cord; instead, the external
memory is added to the Cord and reference-counted. This data may not be
changed for the life of the Cord, though it may be prepended or appended
to.
`MakeCordFromExternal()` takes a callable "releaser" that is invoked when
the reference count for `data` reaches zero. As noted above, this data must
remain live until the releaser is invoked. The callable releaser also must:
* be move constructible
* support `void operator()(absl::string_view) const` or `void operator()`
Example:
Cord MakeCord(BlockPool* pool) {
Block* block = pool->NewBlock();
FillBlock(block);
return absl::MakeCordFromExternal(
block->ToStringView(),
[pool, block](absl::string_view v) {
pool->FreeBlock(block, v);
});
}
WARNING: Because a Cord can be reference-counted, it's likely a bug if your
releaser doesn't do anything. For example, consider the following:
void Foo(const char* buffer, int len) {
auto c = absl::MakeCordFromExternal(absl::string_view(buffer, len),
[](absl::string_view) {});
// BUG: If Bar() copies its cord for any reason, including keeping a
// substring of it, the lifetime of buffer might be extended beyond
// when Foo() returns.
Bar(c);
}
Defined at line 1157 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
Status CancelledError ()Creates a `Status` object with the `absl::StatusCode::kCancelled` error code
and an empty message. It is provided only for efficiency, given that
message-less kCancelled errors are common in the infrastructure.
Defined at line 934 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
Status OkStatus ()OkStatus()
Returns an OK status, equivalent to a default constructed instance. Prefer
usage of `absl::OkStatus()` when constructing such an OK status.
Defined at line 929 of file ../../third_party/abseil-cpp/src/absl/status/status.h
-
template <typename Sequence,typename T,typename LessThan>container_algorithm_internal::ContainerIter<Sequence> c_upper_bound (Sequence &sequence,const T &value,LessThan &&comp)Overload of c_upper_bound() for performing a `comp` comparison other than
the default `operator
<
`.
Defined at line 1158 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence, typename T>container_algorithm_internal::ContainerIterPairType<Sequence, Sequence> c_equal_range (Sequence & sequence, const T & value)c_equal_range()
Container-based version of the
<algorithm
> `std::equal_range()` function
to return an iterator pair pointing to the first and last elements in a
sorted container which compare equal to `value`.
Defined at line 1172 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence,typename T,typename LessThan>container_algorithm_internal::ContainerIterPairType<Sequence, Sequence> c_equal_range (Sequence &sequence,const T &value,LessThan &&comp)Overload of c_equal_range() for performing a `comp` comparison other than
the default `operator
<
`.
Defined at line 1182 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence, typename T>bool c_binary_search (const Sequence & sequence, const T & value)c_binary_search()
Container-based version of the
<algorithm
> `std::binary_search()` function
to test if any element in the sorted container contains a value equivalent to
'value'.
Defined at line 1196 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence,typename T,typename LessThan>bool c_binary_search (const Sequence &sequence,const T &value,LessThan &&comp)Overload of c_binary_search() for performing a `comp` comparison other than
the default `operator
<
`.
Defined at line 1206 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C1,typename C2,typename OutputIterator>OutputIterator c_merge (const C1 &c1,const C2 &c2,OutputIteratorresult)c_merge()
Container-based version of the
<algorithm
> `std::merge()` function
to merge two sorted containers into a single sorted iterator.
Defined at line 1222 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C1,typename C2,typename OutputIterator,typename LessThan>OutputIterator c_merge (const C1 &c1,const C2 &c2,OutputIteratorresult,LessThan &&comp)Overload of c_merge() for performing a `comp` comparison other than
the default `operator
<
`.
Defined at line 1233 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename H>H AbslHashValue (H h, TimeZone tz)Defined at line 1245 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C>void c_inplace_merge (C & c, container_algorithm_internal::ContainerIter<C> middle)c_inplace_merge()
Container-based version of the
<algorithm
> `std::inplace_merge()` function
to merge a supplied iterator `middle` into a container.
Defined at line 1247 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C, typename LessThan>void c_inplace_merge (C &c,container_algorithm_internal::ContainerIter<C>middle,LessThan &&comp)Overload of c_inplace_merge() for performing a merge using a `comp` other
than `operator
<
`.
Defined at line 1256 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C1, typename C2>bool c_includes (const C1 & c1, const C2 & c2)c_includes()
Container-based version of the
<algorithm
> `std::includes()` function
to test whether a sorted container `c1` entirely contains another sorted
container `c2`.
Defined at line 1270 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C1,typename C2,typename LessThan>bool c_includes (const C1 &c1,const C2 &c2,LessThan &&comp)Overload of c_includes() for performing a merge using a `comp` other than
`operator
<
`.
Defined at line 1281 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
TimeZone UTCTimeZone ()UTCTimeZone()
Convenience method returning the UTC time zone.
Defined at line 1288 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
TimeZone LocalTimeZone ()LocalTimeZone()
Convenience method returning the local time zone, or UTC if there is
no configured local zone. Warning: Be wary of using LocalTimeZone(),
and particularly so in a server process, as the zone configured for the
local machine should be irrelevant. Prefer an explicit zone name.
Defined at line 1298 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C1,typename C2,typename OutputIterator,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C1>::value, void>::type,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type>OutputIterator c_set_union (const C1 &c1,const C2 &c2,OutputIteratoroutput)c_set_union()
Container-based version of the
<algorithm
> `std::set_union()` function
to return an iterator containing the union of two containers; duplicate
values are not copied into the output.
Defined at line 1302 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
CivilSecond ToCivilSecond (Time t, TimeZone tz)ToCivilSecond()
ToCivilMinute()
ToCivilHour()
ToCivilDay()
ToCivilMonth()
ToCivilYear()
Helpers for TimeZone::At(Time) to return particularly aligned civil times.
Example:
absl::Time t = ...;
absl::TimeZone tz = ...;
const auto cd = absl::ToCivilDay(t, tz);
Defined at line 1316 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C1,typename C2,typename OutputIterator,typename LessThan,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C1>::value, void>::type,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type>OutputIterator c_set_union (const C1 &c1,const C2 &c2,OutputIteratoroutput,LessThan &&comp)Overload of c_set_union() for performing a merge using a `comp` other than
`operator
<
`.
Defined at line 1319 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
CivilMinute ToCivilMinute (Time t, TimeZone tz)Defined at line 1320 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
CivilHour ToCivilHour (Time t, TimeZone tz)Defined at line 1324 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
CivilDay ToCivilDay (Time t, TimeZone tz)Defined at line 1327 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
CivilMonth ToCivilMonth (Time t, TimeZone tz)Defined at line 1330 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
CivilYear ToCivilYear (Time t, TimeZone tz)Defined at line 1334 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C1,typename C2,typename OutputIterator,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C1>::value, void>::type,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type>OutputIterator c_set_intersection (const C1 &c1,const C2 &c2,OutputIteratoroutput)c_set_intersection()
Container-based version of the
<algorithm
> `std::set_intersection()` function
to return an iterator containing the intersection of two sorted containers.
Defined at line 1339 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
Time FromCivil (CivilSecond ct, TimeZone tz)FromCivil()
Helper for TimeZone::At(CivilSecond) that provides "order-preserving
semantics." If the civil time maps to a unique time, that time is
returned. If the civil time is repeated in the given time zone, the
time using the pre-transition offset is returned. Otherwise, the
civil time is skipped in the given time zone, and the transition time
is returned. This means that for any two civil times, ct1 and ct2,
(ct1
<
ct2) => (FromCivil(ct1)
<
= FromCivil(ct2)), the equal case
being when two non-existent civil times map to the same transition time.
Note: Accepts civil times of any alignment.
Defined at line 1350 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename C1,typename C2,typename OutputIterator,typename LessThan,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C1>::value, void>::type,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type>OutputIterator c_set_intersection (const C1 &c1,const C2 &c2,OutputIteratoroutput,LessThan &&comp)Overload of c_set_intersection() for performing a merge using a `comp` other
than `operator
<
`.
Defined at line 1361 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C1,typename C2,typename OutputIterator,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C1>::value, void>::type,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type>OutputIterator c_set_difference (const C1 &c1,const C2 &c2,OutputIteratoroutput)c_set_difference()
Container-based version of the
<algorithm
> `std::set_difference()` function
to return an iterator containing elements present in the first container but
not in the second.
Defined at line 1387 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C1,typename C2,typename OutputIterator,typename LessThan,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C1>::value, void>::type,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type>OutputIterator c_set_difference (const C1 &c1,const C2 &c2,OutputIteratoroutput,LessThan &&comp)Overload of c_set_difference() for performing a merge using a `comp` other
than `operator
<
`.
Defined at line 1404 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
Time FromDateTime (int64_tyear,intmon,intday,inthour,intmin,intsec,TimeZonetz)FromDateTime()
A convenience wrapper for `absl::ConvertDateTime()` that simply returns
the "pre" `absl::Time`. That is, the unique result, or the instant that
is correct using the pre-transition offset (as if the transition never
happened).
Example:
absl::Time t = absl::FromDateTime(2017, 9, 26, 9, 30, 0, lax);
// t = 2017-09-26 09:30:00 -0700
Deprecated. Use `absl::FromCivil(CivilSecond, TimeZone)`. Note that the
behavior of `FromCivil()` differs from `FromDateTime()` for skipped civil
times. If you care about that see `absl::TimeZone::At(absl::CivilSecond)`.
Defined at line 1420 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
void PrintTo (const absl::LogEntry & entry, std::ostream * os) -
template <typename C1,typename C2,typename OutputIterator,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C1>::value, void>::type,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type>OutputIterator c_set_symmetric_difference (const C1 &c1,const C2 &c2,OutputIteratoroutput)c_set_symmetric_difference()
Container-based version of the
<algorithm
> `std::set_symmetric_difference()`
function to return an iterator containing elements present in either one
container or the other, but not both.
Defined at line 1425 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C1,typename C2,typename OutputIterator,typename LessThan,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C1>::value, void>::type,typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type>OutputIterator c_set_symmetric_difference (const C1 &c1,const C2 &c2,OutputIteratoroutput,LessThan &&comp)Overload of c_set_symmetric_difference() for performing a merge using a
`comp` other than `operator
<
`.
Defined at line 1443 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer>void c_push_heap (RandomAccessContainer & sequence)c_push_heap()
Container-based version of the
<algorithm
> `std::push_heap()` function
to push a value onto a container heap.
Defined at line 1462 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer, typename LessThan>void c_push_heap (RandomAccessContainer & sequence, LessThan && comp)Overload of c_push_heap() for performing a push operation on a heap using a
`comp` other than `operator
<
`.
Defined at line 1471 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer>void c_pop_heap (RandomAccessContainer & sequence)c_pop_heap()
Container-based version of the
<algorithm
> `std::pop_heap()` function
to pop a value from a heap container.
Defined at line 1483 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer, typename LessThan>void c_pop_heap (RandomAccessContainer & sequence, LessThan && comp)Overload of c_pop_heap() for performing a pop operation on a heap using a
`comp` other than `operator
<
`.
Defined at line 1492 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer>void c_make_heap (RandomAccessContainer & sequence)c_make_heap()
Container-based version of the
<algorithm
> `std::make_heap()` function
to make a container a heap.
Defined at line 1504 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer, typename LessThan>void c_make_heap (RandomAccessContainer & sequence, LessThan && comp)Overload of c_make_heap() for performing heap comparisons using a
`comp` other than `operator
<
`
Defined at line 1513 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer>void c_sort_heap (RandomAccessContainer & sequence)c_sort_heap()
Container-based version of the
<algorithm
> `std::sort_heap()` function
to sort a heap into ascending order (after which it is no longer a heap).
Defined at line 1525 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer, typename LessThan>void c_sort_heap (RandomAccessContainer & sequence, LessThan && comp)Overload of c_sort_heap() for performing heap comparisons using a
`comp` other than `operator
<
`
Defined at line 1534 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer>bool c_is_heap (const RandomAccessContainer & sequence)c_is_heap()
Container-based version of the
<algorithm
> `std::is_heap()` function
to check whether the given container is a heap.
Defined at line 1546 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer, typename LessThan>bool c_is_heap (const RandomAccessContainer & sequence, LessThan && comp)Overload of c_is_heap() for performing heap comparisons using a
`comp` other than `operator
<
`
Defined at line 1555 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer>container_algorithm_internal::ContainerIter<RandomAccessContainer> c_is_heap_until (RandomAccessContainer & sequence)c_is_heap_until()
Container-based version of the
<algorithm
> `std::is_heap_until()` function
to find the first element in a given container which is not in heap order.
Defined at line 1567 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename RandomAccessContainer, typename LessThan>container_algorithm_internal::ContainerIter<RandomAccessContainer> c_is_heap_until (RandomAccessContainer & sequence, LessThan && comp)Overload of c_is_heap_until() for performing heap comparisons using a
`comp` other than `operator
<
`
Defined at line 1577 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence>container_algorithm_internal::ContainerIter<Sequence> c_min_element (Sequence & sequence)c_min_element()
Container-based version of the
<algorithm
> `std::min_element()` function
to return an iterator pointing to the element with the smallest value, using
`operator
<
` to make the comparisons.
Defined at line 1595 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence, typename LessThan>container_algorithm_internal::ContainerIter<Sequence> c_min_element (Sequence & sequence, LessThan && comp)Overload of c_min_element() for performing a `comp` comparison other than
`operator
<
`.
Defined at line 1605 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence>container_algorithm_internal::ContainerIter<Sequence> c_max_element (Sequence & sequence)c_max_element()
Container-based version of the
<algorithm
> `std::max_element()` function
to return an iterator pointing to the element with the largest value, using
`operator
<
` to make the comparisons.
Defined at line 1619 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence, typename LessThan>container_algorithm_internal::ContainerIter<Sequence> c_max_element (Sequence & sequence, LessThan && comp)Overload of c_max_element() for performing a `comp` comparison other than
`operator
<
`.
Defined at line 1629 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C>container_algorithm_internal::ContainerIterPairType<C, C> c_minmax_element (C & c)c_minmax_element()
Container-based version of the
<algorithm
> `std::minmax_element()` function
to return a pair of iterators pointing to the elements containing the
smallest and largest values, respectively, using `operator
<
` to make the
comparisons.
Defined at line 1644 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C, typename LessThan>container_algorithm_internal::ContainerIterPairType<C, C> c_minmax_element (C & c, LessThan && comp)Overload of c_minmax_element() for performing `comp` comparisons other than
`operator
<
`.
Defined at line 1654 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence1, typename Sequence2>bool c_lexicographical_compare (const Sequence1 & sequence1, const Sequence2 & sequence2)c_lexicographical_compare()
Container-based version of the
<algorithm
> `std::lexicographical_compare()`
function to lexicographically compare (e.g. sort words alphabetically) two
container sequences. The comparison is performed using `operator
<
`. Note
that capital letters ("A-Z") have ASCII values less than lowercase letters
("a-z").
Defined at line 1674 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence1,typename Sequence2,typename LessThan>bool c_lexicographical_compare (const Sequence1 &sequence1,const Sequence2 &sequence2,LessThan &&comp)Overload of c_lexicographical_compare() for performing a lexicographical
comparison using a `comp` operator instead of `operator
<
`.
Defined at line 1686 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C>bool c_next_permutation (C & c)c_next_permutation()
Container-based version of the
<algorithm
> `std::next_permutation()` function
to rearrange a container's elements into the next lexicographically greater
permutation.
Defined at line 1702 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C, typename LessThan>bool c_next_permutation (C & c, LessThan && comp)Overload of c_next_permutation() for performing a lexicographical
comparison using a `comp` operator instead of `operator
<
`.
Defined at line 1710 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C>bool c_prev_permutation (C & c)c_prev_permutation()
Container-based version of the
<algorithm
> `std::prev_permutation()` function
to rearrange a container's elements into the next lexicographically lesser
permutation.
Defined at line 1723 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename C, typename LessThan>bool c_prev_permutation (C & c, LessThan && comp)Overload of c_prev_permutation() for performing a lexicographical
comparison using a `comp` operator instead of `operator
<
`.
Defined at line 1731 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence, typename T>void c_iota (Sequence & sequence, const T & value)c_iota()
Container-based version of the
<numeric
> `std::iota()` function
to compute successive values of `value`, as if incremented with `++value`
after each element is written, and write them to the container.
Defined at line 1748 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence, typename T>decay_t<T> c_accumulate (const Sequence & sequence, T && init)c_accumulate()
Container-based version of the
<numeric
> `std::accumulate()` function
to accumulate the element values of a container to `init` and return that
accumulation by value.
Note: Due to a language technicality this function has return type
absl::decay_t
<T
>. As a user of this function you can casually read
this as "returns T by value" and assume it does the right thing.
Defined at line 1764 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence,typename T,typename BinaryOp>decay_t<T> c_accumulate (const Sequence &sequence,T &&init,BinaryOp &&binary_op)Overload of c_accumulate() for using a binary operations other than
addition for computing the accumulation.
Defined at line 1774 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence1,typename Sequence2,typename T>decay_t<T> c_inner_product (const Sequence1 &factors1,const Sequence2 &factors2,T &&sum)c_inner_product()
Container-based version of the
<numeric
> `std::inner_product()` function
to compute the cumulative inner product of container element pairs.
Note: Due to a language technicality this function has return type
absl::decay_t
<T
>. As a user of this function you can casually read
this as "returns T by value" and assume it does the right thing.
Defined at line 1791 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename Sequence1,typename Sequence2,typename T,typename BinaryOp1,typename BinaryOp2>decay_t<T> c_inner_product (const Sequence1 &factors1,const Sequence2 &factors2,T &&sum,BinaryOp1 &&op1,BinaryOp2 &&op2)Overload of c_inner_product() for using binary operations other than
`operator+` (for computing the accumulation) and `operator*` (for computing
the product between the two container's element pair).
Defined at line 1804 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename InputSequence, typename OutputIt>OutputIt c_adjacent_difference (const InputSequence & input, OutputIt output_first)c_adjacent_difference()
Container-based version of the
<numeric
> `std::adjacent_difference()`
function to compute the difference between each element and the one preceding
it and write it to an iterator.
Defined at line 1820 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename InputSequence,typename OutputIt,typename BinaryOp>OutputIt c_adjacent_difference (const InputSequence &input,OutputItoutput_first,BinaryOp &&op)Overload of c_adjacent_difference() for using a binary operation other than
subtraction to compute the adjacent difference.
Defined at line 1830 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename InputSequence, typename OutputIt>OutputIt c_partial_sum (const InputSequence & input, OutputIt output_first)c_partial_sum()
Container-based version of the
<numeric
> `std::partial_sum()` function
to compute the partial sum of the elements in a sequence and write them
to an iterator. The partial sum is the sum of all element values so far in
the sequence.
Defined at line 1844 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
template <typename InputSequence,typename OutputIt,typename BinaryOp>OutputIt c_partial_sum (const InputSequence &input,OutputItoutput_first,BinaryOp &&op)Overload of c_partial_sum() for using a binary operation other than addition
to compute the "partial sum".
Defined at line 1854 of file ../../third_party/abseil-cpp/src/absl/algorithm/container.h
-
std::ostream & operator<< (std::ostream & os, int128 v) -
std::ostream & operator<< (std::ostream & os, const Status & x)operator
<
<
()
Prints a human-readable representation of `x` to `os`.
-
bool IsAborted (const Status & status)IsAborted()
IsAlreadyExists()
IsCancelled()
IsDataLoss()
IsDeadlineExceeded()
IsFailedPrecondition()
IsInternal()
IsInvalidArgument()
IsNotFound()
IsOutOfRange()
IsPermissionDenied()
IsResourceExhausted()
IsUnauthenticated()
IsUnavailable()
IsUnimplemented()
IsUnknown()
These convenience functions return `true` if a given status matches the
`absl::StatusCode` error code of its associated function.
-
bool IsAlreadyExists (const Status & status) -
bool IsCancelled (const Status & status) -
bool IsDataLoss (const Status & status) -
bool IsDeadlineExceeded (const Status & status) -
bool IsFailedPrecondition (const Status & status) -
bool IsInternal (const Status & status) -
bool IsInvalidArgument (const Status & status) -
bool IsNotFound (const Status & status) -
bool IsOutOfRange (const Status & status) -
bool IsPermissionDenied (const Status & status) -
bool IsResourceExhausted (const Status & status) -
bool IsUnauthenticated (const Status & status) -
bool IsUnavailable (const Status & status) -
bool IsUnimplemented (const Status & status) -
bool operator== (uint128 lhs, uint128 rhs)Comparison operators.
Defined at line 820 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
Duration InfiniteDuration ()InfiniteDuration()
Returns an infinite `Duration`. To get a `Duration` representing negative
infinity, use `-InfiniteDuration()`.
Duration arithmetic overflows to +/- infinity and saturates. In general,
arithmetic with `Duration` infinities is similar to IEEE 754 infinities
except where IEEE 754 NaN would be involved, in which case +/-
`InfiniteDuration()` is used in place of a "nan" Duration.
Examples:
constexpr absl::Duration inf = absl::InfiniteDuration();
const absl::Duration d = ... any finite duration ...
inf == inf + inf
inf == inf + d
inf == inf - inf
-inf == d - inf
inf == d * 1e100
inf == inf / 2
0 == d / inf
INT64_MAX == inf / d
d
<
inf
-inf
<
d
// Division by zero returns infinity, or INT64_MIN/MAX where appropriate.
inf == d / 0
INT64_MAX == d / absl::ZeroDuration()
The examples involving the `/` operator above also apply to `IDivDuration()`
and `FDivDuration()`.
Defined at line 1818 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool ParseCivilTime (absl::string_view s, CivilMinute * c) -
bool ParseCivilTime (absl::string_view s, CivilHour * c) -
CivilDay PrevWeekday (CivilDay cd, Weekday wd)Defined at line 420 of file ../../third_party/abseil-cpp/src/absl/time/civil_time.h
-
int GetYearDay (CivilSecond cs)GetYearDay()
Returns the day-of-year for the given (realigned) civil-time value.
Example:
absl::CivilDay a(2015, 1, 1);
int yd_jan_1 = absl::GetYearDay(a); // yd_jan_1 = 1
absl::CivilDay b(2015, 12, 31);
int yd_dec_31 = absl::GetYearDay(b); // yd_dec_31 = 365
Defined at line 435 of file ../../third_party/abseil-cpp/src/absl/time/civil_time.h
-
template <typename T>bool operator== (Span<T> a, Span<T> b)operator==
Defined at line 538 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator== (Span<const T> a, Span<T> b)Defined at line 542 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator== (Span<T> a, Span<const T> b)Defined at line 547 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator== (const U & a, Span<T> b)Defined at line 554 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator== (Span<T> a, const U & b)Defined at line 560 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator!= (Span<T> a, Span<T> b)operator!=
Defined at line 566 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator!= (Span<const T> a, Span<T> b)Defined at line 570 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator!= (Span<T> a, Span<const T> b)Defined at line 575 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator!= (const U & a, Span<T> b)Defined at line 582 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator!= (Span<T> a, const U & b)Defined at line 588 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator< (Span<T> a, Span<T> b)operator
<
Defined at line 594 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator< (Span<const T> a, Span<T> b)Defined at line 598 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator< (Span<T> a, Span<const T> b)Defined at line 602 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator< (const U & a, Span<T> b)Defined at line 608 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator< (Span<T> a, const U & b)Defined at line 614 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator> (Span<T> a, Span<T> b)operator>
Defined at line 620 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator> (Span<const T> a, Span<T> b)Defined at line 624 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator> (Span<T> a, Span<const T> b)Defined at line 628 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator> (const U & a, Span<T> b)Defined at line 634 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator> (Span<T> a, const U & b)Defined at line 640 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator<= (Span<T> a, Span<T> b)operator
<
=
Defined at line 646 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator<= (Span<const T> a, Span<T> b)Defined at line 650 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator<= (Span<T> a, Span<const T> b)Defined at line 655 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator<= (const U & a, Span<T> b)Defined at line 662 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator<= (Span<T> a, const U & b)Defined at line 668 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator>= (Span<T> a, Span<T> b)operator>=
Defined at line 674 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator>= (Span<const T> a, Span<T> b)Defined at line 678 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T>bool operator>= (Span<T> a, Span<const T> b)Defined at line 683 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator>= (const U & a, Span<T> b)Defined at line 690 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <typename T,typename U,typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>>bool operator>= (Span<T> a, const U & b)Defined at line 696 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <int&... ExplicitArgumentBarrier, typename T>Span<T> MakeSpan (T * _Nullable ptr, size_t size)MakeSpan()
Constructs a mutable `Span
<T
>`, deducing `T` automatically from either a
container or pointer+size.
Because a read-only `Span
<const
T>` is implicitly constructed from container
types regardless of whether the container itself is a const container,
constructing mutable spans of type `Span
<T
>` from containers requires
explicit constructors. The container-accepting version of `MakeSpan()`
deduces the type of `T` by the constness of the pointer received from the
container's `data()` member. Similarly, the pointer-accepting version returns
a `Span
<const
T>` if `T` is `const`, and a `Span
<T
>` otherwise.
Examples:
void MyRoutine(absl::Span
<MyComplicatedType
> a) {
...
};
// my_vector is a container of non-const types
std::vector
<MyComplicatedType
> my_vector;
// Constructing a Span implicitly attempts to create a Span of type
// `Span
<const
T>`
MyRoutine(my_vector); // error, type mismatch
// Explicitly constructing the Span is verbose
MyRoutine(absl::Span
<MyComplicatedType
>(my_vector));
// Use MakeSpan() to make an absl::Span
<T
>
MyRoutine(absl::MakeSpan(my_vector));
// Construct a span from an array ptr+size
absl::Span
<T
> my_span() {
return absl::MakeSpan(
&array
[0], num_elements_);
}
Defined at line 737 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <int&... ExplicitArgumentBarrier, typename T>Span<T> MakeSpan (T * _Nullable begin, T * _Nullable end)Defined at line 743 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <int&... ExplicitArgumentBarrier, typename C>std::enable_if_t<span_internal::IsView<C>::value, decltype(absl::MakeSpan(span_internal::GetData(c), c.size()))> MakeSpan (C & c)Defined at line 750 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <int&... ExplicitArgumentBarrier, typename C>std::enable_if_t<!span_internal::IsView<C>::value, decltype(absl::MakeSpan(span_internal::GetData(c), c.size()))> MakeSpan (C & c)Defined at line 758 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <int&... ExplicitArgumentBarrier,typename T,size_t N>Span<T> MakeSpan (T (&)[N] array)Defined at line 767 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <int&... ExplicitArgumentBarrier, typename T>Span<const T> MakeConstSpan (T * _Nullable ptr, size_t size)MakeConstSpan()
Constructs a `Span
<const
T>` as with `MakeSpan`, deducing `T` automatically,
but always returning a `Span
<const
T>`.
Examples:
void ProcessInts(absl::Span
<const
int> some_ints);
// Call with a pointer and size.
int array[3] = { 0, 0, 0 };
ProcessInts(absl::MakeConstSpan(
&array
[0], 3));
// Call with a [begin, end) pair.
ProcessInts(absl::MakeConstSpan(
&array
[0],
&array
[3]));
// Call directly with an array.
ProcessInts(absl::MakeConstSpan(array));
// Call with a contiguous container.
std::vector
<int
> some_ints = ...;
ProcessInts(absl::MakeConstSpan(some_ints));
ProcessInts(absl::MakeConstSpan(std::vector
<int
>{ 0, 0, 0 }));
Defined at line 797 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <int&... ExplicitArgumentBarrier, typename T>Span<const T> MakeConstSpan (T * _Nullable begin, T * _Nullable end)Defined at line 803 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <int&... ExplicitArgumentBarrier, typename C>std::enable_if_t<span_internal::IsView<C>::value, decltype(MakeSpan(c))> MakeConstSpan (const C & c)Defined at line 811 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <int&... ExplicitArgumentBarrier, typename C>std::enable_if_t<!span_internal::IsView<C>::value, decltype(MakeSpan(c))> MakeConstSpan (const C & c)Defined at line 818 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
template <int&... ExplicitArgumentBarrier,typename T,size_t N>Span<const T> MakeConstSpan (const T (&)[N] array)Defined at line 825 of file ../../third_party/abseil-cpp/src/absl/types/span.h
-
uint128 operator<< (uint128 lhs, int amount)Arithmetic operators.
Defined at line 960 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
uint128 operator>> (uint128 lhs, int amount)Defined at line 974 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
uint128 operator+ (uint128 lhs, uint128 rhs)Defined at line 999 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
uint128 operator- (uint128 lhs, uint128 rhs)Defined at line 1022 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
uint128 operator* (uint128 lhs, uint128 rhs)Defined at line 1059 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
uint128 operator/ (uint128 lhs, uint128 rhs)Defined at line 1066 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
uint128 operator% (uint128 lhs, uint128 rhs)Defined at line 1071 of file ../../third_party/abseil-cpp/src/absl/numeric/int128.h
-
int64_t ToInt64Nanoseconds (Duration d)ToInt64Nanoseconds()
ToInt64Microseconds()
ToInt64Milliseconds()
ToInt64Seconds()
ToInt64Minutes()
ToInt64Hours()
Helper functions that convert a Duration to an integral count of the
indicated unit. These return the same results as the `IDivDuration()`
function, though they usually do so more efficiently; see the
documentation of `IDivDuration()` for details about overflow, etc.
Example:
absl::Duration d = absl::Milliseconds(1500);
int64_t isec = absl::ToInt64Seconds(d); // isec == 1
Defined at line 1868 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64Microseconds (Duration d)Defined at line 1878 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64Milliseconds (Duration d)Defined at line 1890 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64Seconds (Duration d)Defined at line 1902 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64Minutes (Duration d)Defined at line 1909 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64Hours (Duration d)Defined at line 1916 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
double ToDoubleNanoseconds (Duration d)ToDoubleNanoseconds()
ToDoubleMicroseconds()
ToDoubleMilliseconds()
ToDoubleSeconds()
ToDoubleMinutes()
ToDoubleHours()
Helper functions that convert a Duration to a floating point count of the
indicated unit. These functions are shorthand for the `FDivDuration()`
function above; see its documentation for details about overflow, etc.
Example:
absl::Duration d = absl::Milliseconds(1500);
double dsec = absl::ToDoubleSeconds(d); // dsec == 1.5
-
double ToDoubleMicroseconds (Duration d) -
double ToDoubleMilliseconds (Duration d) -
double ToDoubleSeconds (Duration d) -
double ToDoubleMinutes (Duration d) -
double ToDoubleHours (Duration d) -
Duration FromChrono (const std::chrono::nanoseconds & d)FromChrono()
Converts any of the pre-defined std::chrono durations to an absl::Duration.
Example:
std::chrono::milliseconds ms(123);
absl::Duration d = absl::FromChrono(ms);
Defined at line 1823 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration FromChrono (const std::chrono::microseconds & d)Defined at line 1827 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration FromChrono (const std::chrono::milliseconds & d)Defined at line 1831 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration FromChrono (const std::chrono::seconds & d)Defined at line 1835 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration FromChrono (const std::chrono::minutes & d)Defined at line 1839 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration FromChrono (const std::chrono::hours & d)Defined at line 1843 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
std::chrono::nanoseconds ToChronoNanoseconds (Duration d)ToChronoNanoseconds()
ToChronoMicroseconds()
ToChronoMilliseconds()
ToChronoSeconds()
ToChronoMinutes()
ToChronoHours()
Converts an absl::Duration to any of the pre-defined std::chrono durations.
If overflow would occur, the returned value will saturate at the min/max
chrono duration value instead.
Example:
absl::Duration d = absl::Microseconds(123);
auto x = absl::ToChronoMicroseconds(d);
auto y = absl::ToChronoNanoseconds(d); // x == y
auto z = absl::ToChronoSeconds(absl::InfiniteDuration());
// z == std::chrono::seconds::max()
-
std::chrono::microseconds ToChronoMicroseconds (Duration d) -
std::chrono::milliseconds ToChronoMilliseconds (Duration d) -
std::chrono::seconds ToChronoSeconds (Duration d) -
std::chrono::minutes ToChronoMinutes (Duration d) -
std::chrono::hours ToChronoHours (Duration d) -
std::string FormatDuration (Duration d)FormatDuration()
Returns a string representing the duration in the form "72h3m0.5s".
Returns "inf" or "-inf" for +/- `InfiniteDuration()`.
-
bool ParseDuration (absl::string_view dur_string, Duration * d)ParseDuration()
Parses a duration string consisting of a possibly signed sequence of
decimal numbers, each with an optional fractional part and a unit
suffix. The valid suffixes are "ns", "us" "ms", "s", "m", and "h".
Simple examples include "300ms", "-1.5h", and "2h45m". Parses "0" as
`ZeroDuration()`. Parses "inf" and "-inf" as +/- `InfiniteDuration()`.
-
bool AbslParseFlag (absl::string_viewtext,Duration *dst,std::string *error)AbslParseFlag()
Parses a command-line flag string representation `text` into a Duration
value. Duration flags must be specified in a format that is valid input for
`absl::ParseDuration()`.
-
std::string AbslUnparseFlag (Duration d)AbslUnparseFlag()
Unparses a Duration value into a command-line string representation using
the format specified by `absl::ParseDuration()`.
-
bool ParseFlag (const std::string &text,Duration *dst,std::string *error) -
std::string UnparseFlag (Duration d) -
std::ostream & operator<< (std::ostream & os, Duration d)Output stream operator.
Defined at line 709 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator== (const Cord & lhs, const Cord & rhs)Nonmember Cord-to-Cord relational operators.
Defined at line 1704 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
std::strong_ordering operator<=> (Time lhs, Time rhs)Defined at line 885 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator< (Time lhs, Time rhs)Defined at line 892 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator== (Time lhs, Time rhs)Defined at line 904 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration operator- (Time lhs, Time rhs)Defined at line 921 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Time UniversalEpoch ()UniversalEpoch()
Returns the `absl::Time` representing "0001-01-01 00:00:00.0 +0000", the
epoch of the ICU Universal Time Scale.
Defined at line 934 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Time InfiniteFuture ()InfiniteFuture()
Returns an `absl::Time` that is infinitely far in the future.
Defined at line 944 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Time InfinitePast ()InfinitePast()
Returns an `absl::Time` that is infinitely far in the past.
Defined at line 952 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator!= (const Cord & x, const Cord & y)Defined at line 1711 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator< (const Cord & x, const Cord & y)Defined at line 1712 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator== (const Cord & lhs, absl::string_view rhs)Nonmember Cord-to-absl::string_view relational operators.
Due to implicit conversions, these also enable comparisons of Cord with
std::string and const char*.
Defined at line 1725 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
Time FromUnixNanos (int64_t ns)FromUnixNanos()
FromUnixMicros()
FromUnixMillis()
FromUnixSeconds()
FromTimeT()
FromUDate()
FromUniversal()
Creates an `absl::Time` from a variety of other representations. See
https://unicode-org.github.io/icu/userguide/datetime/universaltimescale.html
Defined at line 1848 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Time FromUnixMicros (int64_t us)Defined at line 1852 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Time FromUnixMillis (int64_t ms)Defined at line 1856 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Time FromUnixSeconds (int64_t s)Defined at line 1860 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Time FromTimeT (time_t t)Defined at line 1864 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Time FromUDate (double udate) -
Time FromUniversal (int64_t universal) -
int64_t ToUnixNanos (Time t)ToUnixNanos()
ToUnixMicros()
ToUnixMillis()
ToUnixSeconds()
ToTimeT()
ToUDate()
ToUniversal()
Converts an `absl::Time` to a variety of other representations. See
https://unicode-org.github.io/icu/userguide/datetime/universaltimescale.html
Note that these operations round down toward negative infinity where
necessary to adjust to the resolution of the result type. Beware of
possible time_t over/underflow in ToTime{T,val,spec}() on 32-bit platforms.
-
int64_t ToUnixMicros (Time t) -
int64_t ToUnixMillis (Time t) -
int64_t ToUnixSeconds (Time t) -
time_t ToTimeT (Time t) -
double ToUDate (Time t) -
int64_t ToUniversal (Time t) -
Duration DurationFromTimespec (timespec ts)DurationFromTimespec()
DurationFromTimeval()
ToTimespec()
ToTimeval()
TimeFromTimespec()
TimeFromTimeval()
ToTimespec()
ToTimeval()
Some APIs use a timespec or a timeval as a Duration (e.g., nanosleep(2)
and select(2)), while others use them as a Time (e.g. clock_gettime(2)
and gettimeofday(2)), so conversion functions are provided for both cases.
The "to timespec/val" direction is easily handled via overloading, but
for "from timespec/val" the desired type is part of the function name.
-
Duration DurationFromTimeval (timeval tv) -
timespec ToTimespec (Duration d) -
timeval ToTimeval (Duration d) -
Time TimeFromTimespec (timespec ts) -
Time TimeFromTimeval (timeval tv) -
timespec ToTimespec (Time t) -
timeval ToTimeval (Time t) -
Time FromChrono (const std::chrono::system_clock::time_point & tp)FromChrono()
Converts a std::chrono::system_clock::time_point to an absl::Time.
Example:
auto tp = std::chrono::system_clock::from_time_t(123);
absl::Time t = absl::FromChrono(tp);
// t == absl::FromTimeT(123)
-
std::chrono::system_clock::time_point ToChronoTime (Time )ToChronoTime()
Converts an absl::Time to a std::chrono::system_clock::time_point. If
overflow would occur, the returned value will saturate at the min/max time
point value instead.
Example:
absl::Time t = absl::FromTimeT(123);
auto tp = absl::ToChronoTime(t);
// tp == std::chrono::system_clock::from_time_t(123);
-
bool AbslParseFlag (absl::string_viewtext,Time *t,std::string *error)AbslParseFlag()
Parses the command-line flag string representation `text` into a Time value.
Time flags must be specified in a format that matches absl::RFC3339_full.
For example:
--start_time=2016-01-02T03:04:05.678+08:00
Note: A UTC offset (or 'Z' indicating a zero-offset from UTC) is required.
Additionally, if you'd like to specify a time as a count of
seconds/milliseconds/etc from the Unix epoch, use an absl::Duration flag
and add that duration to absl::UnixEpoch() to get an absl::Time.
-
std::string AbslUnparseFlag (Time t)AbslUnparseFlag()
Unparses a Time value into a command-line string representation using
the format specified by `absl::ParseTime()`.
-
bool ParseFlag (const std::string &text,Time *t,std::string *error) -
std::string UnparseFlag (Time t) -
std::ostream & operator<< (std::ostream & out, const Cord & cord)allow a Cord to be logged
-
Time FromTM (const struct tm & tm, TimeZone tz)FromTM()
Converts the `tm_year`, `tm_mon`, `tm_mday`, `tm_hour`, `tm_min`, and
`tm_sec` fields to an `absl::Time` using the given time zone. See ctime(3)
for a description of the expected values of the tm fields. If the civil time
is unique (see `absl::TimeZone::At(absl::CivilSecond)` above), the matching
time instant is returned. Otherwise, the `tm_isdst` field is consulted to
choose between the possible results. For a repeated civil time, `tm_isdst !=
0` returns the matching DST instant, while `tm_isdst == 0` returns the
matching non-DST instant. For a skipped civil time there is no matching
instant, so `tm_isdst != 0` returns the DST instant, and `tm_isdst == 0`
returns the non-DST instant, that would have matched if the transition never
happened.
-
struct tm ToTM (Time t, TimeZone tz)ToTM()
Converts the given `absl::Time` to a struct tm using the given time zone.
See ctime(3) for a description of the values of the tm fields.
-
std::string FormatTime (absl::string_viewformat,Timet,TimeZonetz)FormatTime()
Formats the given `absl::Time` in the `absl::TimeZone` according to the
provided format string. Uses strftime()-like formatting options, with
the following extensions:
- %Ez - RFC3339-compatible numeric UTC offset (+hh:mm or -hh:mm)
- %E*z - Full-resolution numeric UTC offset (+hh:mm:ss or -hh:mm:ss)
- %E#S - Seconds with # digits of fractional precision
- %E*S - Seconds with full fractional precision (a literal '*')
- %E#f - Fractional seconds with # digits of precision
- %E*f - Fractional seconds with full precision (a literal '*')
- %E4Y - Four-character years (-999 ... -001, 0000, 0001 ... 9999)
- %ET - The RFC3339 "date-time" separator "T"
Note that %E0S behaves like %S, and %E0f produces no characters. In
contrast %E*f always produces at least one digit, which may be '0'.
Note that %Y produces as many characters as it takes to fully render the
year. A year outside of [-999:9999] when formatted with %E4Y will produce
more than four characters, just like %Y.
We recommend that format strings include the UTC offset (%z, %Ez, or %E*z)
so that the result uniquely identifies a time instant.
Example:
absl::CivilSecond cs(2013, 1, 2, 3, 4, 5);
absl::Time t = absl::FromCivil(cs, lax);
std::string f = absl::FormatTime("%H:%M:%S", t, lax); // "03:04:05"
f = absl::FormatTime("%H:%M:%E3S", t, lax); // "03:04:05.000"
Note: If the given `absl::Time` is `absl::InfiniteFuture()`, the returned
string will be exactly "infinite-future". If the given `absl::Time` is
`absl::InfinitePast()`, the returned string will be exactly "infinite-past".
In both cases the given format string and `absl::TimeZone` are ignored.
-
std::string FormatTime (Time t, TimeZone tz)Convenience functions that format the given time using the RFC3339_full
format. The first overload uses the provided TimeZone, while the second
uses LocalTimeZone().
-
std::string FormatTime (Time t) -
bool ParseTime (absl::string_viewformat,absl::string_viewinput,Time *time,std::string *err)ParseTime()
Parses an input string according to the provided format string and
returns the corresponding `absl::Time`. Uses strftime()-like formatting
options, with the same extensions as FormatTime(), but with the
exceptions that %E#S is interpreted as %E*S, and %E#f as %E*f. %Ez
and %E*z also accept the same inputs, which (along with %z) includes
'z' and 'Z' as synonyms for +00:00. %ET accepts either 'T' or 't'.
%Y consumes as many numeric characters as it can, so the matching data
should always be terminated with a non-numeric. %E4Y always consumes
exactly four characters, including any sign.
Unspecified fields are taken from the default date and time of ...
"1970-01-01 00:00:00.0 +0000"
For example, parsing a string of "15:45" (%H:%M) will return an absl::Time
that represents "1970-01-01 15:45:00.0 +0000".
Note that since ParseTime() returns time instants, it makes the most sense
to parse fully-specified date/time strings that include a UTC offset (%z,
%Ez, or %E*z).
Note also that `absl::ParseTime()` only heeds the fields year, month, day,
hour, minute, (fractional) second, and UTC offset. Other fields, like
weekday (%a or %A), while parsed for syntactic validity, are ignored
in the conversion.
Date and time fields that are out-of-range will be treated as errors
rather than normalizing them like `absl::CivilSecond` does. For example,
it is an error to parse the date "Oct 32, 2013" because 32 is out of range.
A leap second of ":60" is normalized to ":00" of the following minute
with fractional seconds discarded. The following table shows how the
given seconds and subseconds will be parsed:
"59.x" -> 59.x // exact
"60.x" -> 00.0 // normalized
"00.x" -> 00.x // exact
Errors are indicated by returning false and assigning an error message
to the "err" out param if it is non-null.
Note: If the input string is exactly "infinite-future", the returned
`absl::Time` will be `absl::InfiniteFuture()` and `true` will be returned.
If the input string is "infinite-past", the returned `absl::Time` will be
`absl::InfinitePast()` and `true` will be returned.
-
bool ParseTime (absl::string_viewformat,absl::string_viewinput,TimeZonetz,Time *time,std::string *err)Like ParseTime() above, but if the format string does not contain a UTC
offset specification (%z/%Ez/%E*z) then the input is interpreted in the
given TimeZone. This means that the input, by itself, does not identify a
unique instant. Being time-zone dependent, it also admits the possibility
of ambiguity or non-existence, in which case the "pre" time (as defined
by TimeZone::TimeInfo) is returned. For these reasons we recommend that
all date/time strings include a UTC offset so they're context independent.
-
bool operator== (TimeZone a, TimeZone b)Defined at line 1250 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator!= (TimeZone a, TimeZone b)Defined at line 1251 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
std::ostream & operator<< (std::ostream & os, TimeZone tz)Defined at line 1252 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool LoadTimeZone (absl::string_view name, TimeZone * tz)LoadTimeZone()
Loads the named zone. May perform I/O on the initial load of the named
zone. If the name is invalid, or some other kind of error occurs, returns
`false` and `*tz` is set to the UTC time zone.
Defined at line 1264 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
TimeZone FixedTimeZone (int seconds)FixedTimeZone()
Returns a TimeZone that is a fixed offset (seconds east) from UTC.
Note: If the absolute value of the offset is greater than 24 hours
you'll get UTC (i.e., no offset) instead.
Defined at line 1280 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
std::ostream & operator<< (std::ostream & os, Time t)Output stream operator.
Defined at line 1516 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename Sink>void AbslStringify (Sink & sink, Time t)Support for StrFormat(), StrCat() etc.
Defined at line 1522 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool operator> (const Cord & x, const Cord & y)Defined at line 1713 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator<= (const Cord & x, const Cord & y)Defined at line 1714 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator>= (const Cord & x, const Cord & y)Defined at line 1717 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator== (absl::string_view x, const Cord & y)Defined at line 1732 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator!= (const Cord & x, absl::string_view y)Defined at line 1733 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator!= (absl::string_view x, const Cord & y)Defined at line 1734 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator< (const Cord & x, absl::string_view y)Defined at line 1735 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator< (absl::string_view x, const Cord & y)Defined at line 1738 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator> (const Cord & x, absl::string_view y)Defined at line 1741 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator> (absl::string_view x, const Cord & y)Defined at line 1742 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator<= (const Cord & x, absl::string_view y)Defined at line 1743 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator<= (absl::string_view x, const Cord & y)Defined at line 1744 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator>= (const Cord & x, absl::string_view y)Defined at line 1745 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
-
bool operator>= (absl::string_view x, const Cord & y)Defined at line 1746 of file ../../third_party/abseil-cpp/src/absl/strings/cord.h
Variables
const char[] RFC1123_full
const char[] RFC1123_no_wday
const char[] RFC3339_full
const char[] RFC3339_sec
const nontype_t<V> nontype
Defined at line 62 of file ../../third_party/abseil-cpp/src/absl/utility/utility.h