mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Roll forward to cl/314549634
Change-Id: I4d1e7eacd5fa4078a094571ad6d5f51e422535ff
This commit is contained in:
committed by
Alexey Polyudov
parent
ae1c427b99
commit
cffbc04508
@@ -1,9 +1,10 @@
|
||||
#ifndef PLATFORM_V2_BASE_EXCEPTION_H_
|
||||
#define PLATFORM_V2_BASE_EXCEPTION_H_
|
||||
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/meta/type_traits.h"
|
||||
|
||||
namespace location {
|
||||
namespace nearby {
|
||||
|
||||
@@ -64,7 +65,7 @@ class ExceptionOr {
|
||||
ExceptionOr(Exception exception) : exception_{exception} {} // NOLINT
|
||||
// If there exists explicit conversion from from U to T,
|
||||
// then allow explicit conversion from ExceptionOr<U> to ExceptionOr<T>.
|
||||
template <typename U, typename = std::void_t<decltype(T{std::declval<U>()})>>
|
||||
template <typename U, typename = absl::void_t<decltype(T{std::declval<U>()})>>
|
||||
explicit ExceptionOr<T>(ExceptionOr<U> value) {
|
||||
if (!value.ok()) {
|
||||
exception_ = value.GetException();
|
||||
|
||||
Reference in New Issue
Block a user