rtpsw commented on PR #14207:
URL: https://github.com/apache/arrow/pull/14207#issuecomment-1257874379

   It turns out template instantiations and attributes (in this case, 
visibility) do not work together nicely. When I try adding code like 
`template<> class ARROW_EXPORT ArrayVectorSourceNodeOptions`, I get compiler 
errors like:
   ```
   
/mnt/user1/tscontract/github/rtpsw/arrow/cpp/src/arrow/compute/exec/options.h:113:31:
 error: using typedef-name ‘using ArrayVectorSourceNodeOptions = class 
arrow::compute::SchemaSourceNodeOptions<std::function<arrow::Iterator<std::shared_ptr<std::vector<std::shared_ptr<arrow::Array>
 > > >()> >’ after ‘class’
     113 | template<> class ARROW_EXPORT ArrayVectorSourceNodeOptions;
         |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ```
   and when I try adding code like `template<> class ARROW_EXPORT 
SchemaSourceNodeOptions<ArrayVectorIteratorMaker>`, I get compiler warnings 
like:
   ```
   
/mnt/user1/tscontract/github/rtpsw/arrow/cpp/src/arrow/compute/exec/options.h:113:31:
 warning: attributes ignored on template instantiation [-Wattributes]
     113 | template<> class ARROW_EXPORT 
SchemaSourceNodeOptions<ArrayVectorIteratorMaker>;
         |                               
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ```
   So, both tries do not work, at least with my compiler. There seems to be a 
[proposal documenting this 
limitation](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0537r0.html),
 but I'm not sure what its status is.
   
   In the commit I just made, I opted instead to explicitly define and export 
non-template symbols.


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

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

Reply via email to