lukester1975 opened a new issue, #15098:
URL: https://github.com/apache/arrow/issues/15098

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Hi
   
   Compiling
   ```
   #include <arrow/api.h>
   ```
   with `clang-cl test.cpp -I/path/to/arrow /std:c++20`
   
   fails:
   ```
   C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xutility(4588,14): 
error:
         no matching function for call to object of type 'std::equal_to<>'
           if (!_Pred(*_UFirst1, *_UFirst2)) {
                ^~~~~
   C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xutility(4605,17): note:
         in instantiation of function template specialization 'std::equal<const 
arrow::FieldRef
         *, const arrow::FieldRef *, std::equal_to<>>' requested here
       return _STD equal(_First1, _Last1, _First2, equal_to<>{});
                   ^
   C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\vector(2293,21): note:
         in instantiation of function template specialization 'std::equal<const 
arrow::FieldRef
         *, const arrow::FieldRef *>' requested here
           return _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end(), 
_Right._U...
                       ^
   C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xstddef(213,43): note:
         in instantiation of function template specialization 
'std::operator==<arrow::FieldRef,
         std::allocator<arrow::FieldRef>>' requested here
           return static_cast<_Ty1&&>(_Left) == static_cast<_Ty2&&>(_Right);
                                             ^
   C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\variant(1326,20): note:
         in instantiation of function template specialization 
'std::equal_to<>::operator()<const
   
         std::vector<arrow::FieldRef> &, const std::vector<arrow::FieldRef> &>' 
requested here
               return _Op{}(_Variant_raw_get<_Idx>(_Left), _Right._Val);
                      ^
   C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\variant(669,23): note:
         in instantiation of function template specialization
         'std::_Variant_relop_visitor2<std::equal_to<>, bool, arrow::FieldPath,
         std::basic_string<char>,
         
std::vector<arrow::FieldRef>>::operator()<std::vector<arrow::FieldRef>, 2ULL>'
         requested here
           _STL_STAMP(4, _STL_VISIT_STAMP);
                         ^
   C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\variant(714,44): note:
         in instantiation of function template specialization
         
'std::_Variant_raw_visit1<1>::_Visit<std::_Variant_relop_visitor2<std::equal_to<>,
         bool, arrow::FieldPath, std::basic_string<char>, 
std::vector<arrow::FieldRef>>, const
         std::_Variant_storage_<false, arrow::FieldPath, 
std::basic_string<char>,
         std::vector<arrow::FieldRef>> &>' requested here
       return _Variant_raw_visit1<_Strategy>::_Visit(_Idx, 
static_cast<_Fn&&>(_Func), st...
                                              ^
   C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\variant(1340,12): note:
         in instantiation of function template specialization 
'std::_Variant_raw_visit<const
         std::_Variant_storage_<false, arrow::FieldPath, 
std::basic_string<char>,
         std::vector<arrow::FieldRef>> &, 
std::_Variant_relop_visitor2<std::equal_to<>, bool,
         arrow::FieldPath, std::basic_string<char>, 
std::vector<arrow::FieldRef>>>' requested
         here
           && _Variant_raw_visit(_Right_index, _Right._Storage(), 
_Visitor{_Left._Storage()});
              ^
   cpp/src\arrow/type.h(1729,59): note: in instantiation of function template 
specialization
         'std::operator==<arrow::FieldPath, std::basic_string<char>,
         std::vector<arrow::FieldRef>>' requested here
     bool Equals(const FieldRef& other) const { return impl_ == other.impl_; }
                                                             ^
   C:\Program Files\Microsoft Visual 
Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xstddef(210,31): note:
         candidate template ignored: substitution failure [with _Ty1 = const 
arrow::FieldRef &,
         _Ty2 = const arrow::FieldRef &]: ISO C++20 considers use of overloaded 
operator '=='
         (with operand types 'const arrow::FieldRef' and 'const 
arrow::FieldRef') to be
         ambiguous despite there being a unique best viable function
       _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const
   ```
   I don't recall seeing this previously, so maybe a change with the 17.4(.3?) 
release. variant impl, maybe.
   
   A simple `bool operator==(const FieldRef& other) const { return 
Equals(other); }` added to `FieldRef` fixes the compilation. 
   
   Thanks
   
   
   ### Component(s)
   
   C++


-- 
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: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to