Lunderberg commented on PR #14604:
URL: https://github.com/apache/tvm/pull/14604#issuecomment-1513343603

   Interesting.  While the change compiles locally, it looks like the CI is 
having issues with this patch, with the older version of gcc not interpreting 
the deduction guide correctly.
   
   Looking at this specific use case again, it looks like it is also dependent 
on the ambiguity between `Array{first_element, second_element}` and 
`Array{iter_begin, iter_end}`.  The deduction guides would help handle the case 
where the second usage has ambiguous type, but it wouldn't handle the case 
where the first usage is intended.  We may be able to remove this ambiguity by 
moving the static_assert into a SFINAE parameter, so that the 
`initializer_list` case is the only remaining overload.
   
   Can you try making the following change in 
`include/tvm/runtime/container/array.h`?
   
   ```c++
   // Before
   template <typename IterType>
   Array(IterType first, IterType last) {
     static_assert(is_valid_iterator_v<T, IterType>,
                   "IterType cannot be inserted into a tvm::Array<T>");
     Assign(first, last);
   }
   
   // After
   template <typename IterType, typename = 
std::enable_if_t<is_valid_iterator_v<T, IterType>>>
   Array(IterType first, IterType last) {
     Assign(first, last);
   }
   ```
   
   That said, if this is the only instance of this issue, it probably is easier 
to change from `Array{...}` to `Array<ObjectRef>{...}`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to