Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no matching function for call to xt::xfile_value_reference #164

Open
hankliu5 opened this issue Jul 21, 2021 · 0 comments
Open

no matching function for call to xt::xfile_value_reference #164

hankliu5 opened this issue Jul 21, 2021 · 0 comments

Comments

@hankliu5
Copy link
Contributor

Hello all,

I was trying to compile the stored array example in the documentation. However, the compiler gave me the following error message.

In file included from /home/hankliu5/workspace/xtensor-example/xtensor-io-example/src/first_example.cpp:1:0:
/usr/local/include/xtensor-io/xfile_array.hpp: In instantiation of ‘xt::xfile_array_container<E, IOH>::reference xt::xfile_array_container<E, IOH>::operator()(Idxs ...) [with Idxs = {int, int}; E = xt::xarray_container<xt::uvector<long unsigned int, std::allocator<long unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4ul, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>; IOH = xt::xio_disk_handler<xt::xio_binary_config>; xt::xfile_array_container<E, IOH>::reference = xt::xfile_value_reference<long unsigned int>]’:
/home/hankliu5/workspace/xtensor-example/xtensor-io-example/src/first_example.cpp:15:12:   required from here
/usr/local/include/xtensor-io/xfile_array.hpp:539:53: error: no matching function for call to ‘xt::xfile_value_reference<long unsigned int>::xfile_value_reference(long unsigned int&, xt::xfile_dirty&)’
         return reference(m_storage(idxs...), m_dirty);
                                                     ^
In file included from /home/hankliu5/workspace/xtensor-example/xtensor-io-example/src/first_example.cpp:1:0:
/usr/local/include/xtensor-io/xfile_array.hpp:46:9: note: candidate: xt::xfile_value_reference<T>::xfile_value_reference(xt::xfile_value_reference<T>&&) [with T = long unsigned int]
         xfile_value_reference(xfile_value_reference&&) = default;
         ^
/usr/local/include/xtensor-io/xfile_array.hpp:46:9: note:   candidate expects 1 argument, 2 provided
/usr/local/include/xtensor-io/xfile_array.hpp:45:9: note: candidate: xt::xfile_value_reference<T>::xfile_value_reference(const xt::xfile_value_reference<T>&) [with T = long unsigned int]
         xfile_value_reference(const xfile_value_reference&) = default;
         ^
/usr/local/include/xtensor-io/xfile_array.hpp:45:9: note:   candidate expects 1 argument, 2 provided
/usr/local/include/xtensor-io/xfile_array.hpp:270:12: note: candidate: xt::xfile_value_reference<T>::xfile_value_reference(T&, xt::xfile_dirty&, bool&) [with T = long unsigned int]
     inline xfile_value_reference<T>::xfile_value_reference(T& value, xfile_dirty& dirty, bool& inval
            ^
/usr/local/include/xtensor-io/xfile_array.hpp:270:12: note:   candidate expects 3 arguments, 2 provided
In file included from /home/hankliu5/workspace/xtensor-example/xtensor-io-example/src/first_example.cpp:1:0:
/usr/local/include/xtensor-io/xfile_array.hpp: In instantiation of ‘xt::xfile_array_container<E, IOH>::reference xt::xfile_array_container<E, IOH>::operator()(Idxs ...) [with Idxs = {int}; E = xt::xarray_container<xt::uvector<long unsigned int, std::allocator<long unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4ul, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>; IOH = xt::xio_disk_handler<xt::xio_binary_config>; xt::xfile_array_container<E, IOH>::reference = xt::xfile_value_reference<long unsigned int>]’:
/home/hankliu5/workspace/xtensor-example/xtensor-io-example/src/first_example.cpp:35:26:   required from here
/usr/local/include/xtensor-io/xfile_array.hpp:539:53: error: no matching function for call to ‘xt::xfile_value_reference<long unsigned int>::xfile_value_reference(long unsigned int&, xt::xfile_dirty&)’
         return reference(m_storage(idxs...), m_dirty);
                                                     ^
In file included from /home/hankliu5/workspace/xtensor-example/xtensor-io-example/src/first_example.cpp:1:0:
/usr/local/include/xtensor-io/xfile_array.hpp:46:9: note: candidate: xt::xfile_value_reference<T>::xfile_value_reference(xt::xfile_value_reference<T>&&) [with T = long unsigned int]
         xfile_value_reference(xfile_value_reference&&) = default;
         ^
/usr/local/include/xtensor-io/xfile_array.hpp:46:9: note:   candidate expects 1 argument, 2 provided
/usr/local/include/xtensor-io/xfile_array.hpp:45:9: note: candidate: xt::xfile_value_reference<T>::xfile_value_reference(const xt::xfile_value_reference<T>&) [with T = long unsigned int]
         xfile_value_reference(const xfile_value_reference&) = default;
         ^
/usr/local/include/xtensor-io/xfile_array.hpp:45:9: note:   candidate expects 1 argument, 2 provided
/usr/local/include/xtensor-io/xfile_array.hpp:270:12: note: candidate: xt::xfile_value_reference<T>::xfile_value_reference(T&, xt::xfile_dirty&, bool&) [with T = long unsigned int]
     inline xfile_value_reference<T>::xfile_value_reference(T& value, xfile_dirty& dirty, bool& inval
            ^
/usr/local/include/xtensor-io/xfile_array.hpp:270:12: note:   candidate expects 3 arguments, 2 provided
CMakeFiles/first_example.dir/build.make:75: recipe for target 'CMakeFiles/first_example.dir/src/first_example.cpp.o' failed
make[2]: *** [CMakeFiles/first_example.dir/src/first_example.cpp.o] Error 1
CMakeFiles/Makefile2:110: recipe for target 'CMakeFiles/first_example.dir/all' failed
make[1]: *** [CMakeFiles/first_example.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2

After searching the source code, I found out that there is one additional parameter in xfile_value_reference's constructor, which doesn't appear in the stable branch.

I created a pull request (#163) that fixes the missing parameter and now I'm able to compile the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant