Skip to content

Commit 5d7e63f

Browse files
[ADT] Rename value to alt (NFC)
This patch renames value to alt so that the parameter won't collide with member function value().
1 parent 44582af commit 5d7e63f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/include/llvm/ADT/Optional.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,11 @@ template <typename T> class Optional {
315315
constexpr const T &operator*() const & { return getValue(); }
316316
T &operator*() & { return getValue(); }
317317

318-
template <typename U> constexpr T value_or(U &&value) const & {
319-
return hasValue() ? getValue() : std::forward<U>(value);
318+
template <typename U> constexpr T value_or(U &&alt) const & {
319+
return hasValue() ? getValue() : std::forward<U>(alt);
320320
}
321-
template <typename U> constexpr T getValueOr(U &&value) const & {
322-
return hasValue() ? getValue() : std::forward<U>(value);
321+
template <typename U> constexpr T getValueOr(U &&alt) const & {
322+
return hasValue() ? getValue() : std::forward<U>(alt);
323323
}
324324

325325
/// Apply a function to the value if present; otherwise return None.
@@ -334,11 +334,11 @@ template <typename T> class Optional {
334334
T &&getValue() && { return std::move(Storage.getValue()); }
335335
T &&operator*() && { return std::move(Storage.getValue()); }
336336

337-
template <typename U> T value_or(U &&value) && {
338-
return hasValue() ? std::move(getValue()) : std::forward<U>(value);
337+
template <typename U> T value_or(U &&alt) && {
338+
return hasValue() ? std::move(getValue()) : std::forward<U>(alt);
339339
}
340-
template <typename U> T getValueOr(U &&value) && {
341-
return hasValue() ? std::move(getValue()) : std::forward<U>(value);
340+
template <typename U> T getValueOr(U &&alt) && {
341+
return hasValue() ? std::move(getValue()) : std::forward<U>(alt);
342342
}
343343

344344
/// Apply a function to the value if present; otherwise return None.

0 commit comments

Comments
 (0)