File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -242,17 +242,20 @@ struct EValue {
242242 // Template constructor that allows construction from types that can be
243243 // dereferenced to produce a type that EValue can be implicitly constructed
244244 // from.
245- template <typename T>
246- /* implicit*/ EValue(
247- T&& value,
248- typename std::enable_if<std::is_convertible<
249- decltype (*std::forward<T>(value)),
250- EValue>::value>::type* = 0 ) {
245+ template <typename T,
246+ typename = typename std::enable_if<
247+ std::is_convertible<
248+ decltype (*std::forward<T>(std::declval<T>())), // declval to simulate forwarding
249+ EValue
250+ >::value
251+ >::type>
252+ /* implicit*/ EValue(T&& value) {
251253 ET_CHECK_MSG (value != nullptr , " Pointer is null." );
252254 // Note that this ctor does not initialize this->tag directly; it is set by
253255 // moving in the new value.
254256 moveFrom (*std::forward<T>(value));
255- }
257+ }
258+
256259
257260 // Delete constructor for raw pointers to ensure they cannot be used.
258261 template <typename T>
Original file line number Diff line number Diff line change 99#pragma once
1010
1111#include < executorch/runtime/core/tensor_shape_dynamism.h> // @manual
12+ #include < executorch/runtime/platform/compiler.h>
1213#ifdef USE_ATEN_LIB
1314#include < ATen/Tensor.h> // @manual
1415#include < c10/core/Device.h>
You can’t perform that action at this time.
0 commit comments