You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to dump a boolean array leads to the error below.
The code compiles fine if I replace the bool with int.
Is this a bug or am I doing something wrong?
vector<bool> bv = {true,false,true};
auto xbv = xt::adapt(bv);
xt::dump_npz("test.npz","test",xbv,false,false);
leads to the following error:
In file included from /usr/local/include/xtensor/xarray.hpp:20:0,
from /usr/local/include/xtensor/xadapt.hpp:20,
from /usr/local/include/xtensor/xnpy.hpp:34,
from /usr/local/include/xtensor-io/xnpz.hpp:30,
from /home/adminlocal/PhD/cpp/mesh-tools/src/IO/fileIO.h:36,
from /home/adminlocal/PhD/cpp/mesh-tools/src/IO/fileIO.cpp:5:
/usr/local/include/xtensor/xcontainer.hpp: In instantiation of ‘const value_type* xt::xcontainer<D>::data() const [with D = xt::xtensor_adaptor<std::vector<bool>&, 1, (xt::layout_type)1, xt::xtensor_expression_tag>; xt::xcontainer<D>::value_type = bool]’:
/usr/local/include/xtensor/xnpy.hpp:655:26: required from ‘void xt::detail::dump_npy_stream(O&, const xt::xexpression<E2>&) [with O = xt::detail::binary_vector; E = xt::xtensor_adaptor<std::vector<bool>&, 1, (xt::layout_type)1, xt::xtensor_expression_tag>]’
/usr/local/include/xtensor-io/xnpz.hpp:480:32: required from ‘void xt::dump_npz(std::__cxx11::string, std::__cxx11::string, const xt::xexpression<D>&, bool, bool) [with E = xt::xtensor_adaptor<std::vector<bool>&, 1, (xt::layout_type)1, xt::xtensor_expression_tag>; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/home/adminlocal/PhD/cpp/mesh-tools/src/IO/fileIO.cpp:774:51: required from here
/usr/local/include/xtensor/xcontainer.hpp:578:31: error: passing ‘const storage_type {aka const std::vector<bool>}’ as ‘this’ argument discards qualifiers [-fpermissive]
return storage().data();
^
In file included from /usr/include/c++/7/vector:65:0,
from /usr/include/boost/property_map/vector_property_map.hpp:15,
from /usr/include/boost/property_map/property_map.hpp:601,
from /usr/local/include/CGAL/property_map.h:19,
from /home/adminlocal/PhD/cpp/mesh-tools/src/base/cgal_typedefs.h:6,
from /home/adminlocal/PhD/cpp/mesh-tools/src/IO/fileIO.cpp:1:
/usr/include/c++/7/bits/stl_bvector.h:920:5: note: in call to ‘void std::vector<bool, _Alloc>::data() [with _Alloc = std::allocator<bool>]’
data() _GLIBCXX_NOEXCEPT { }
^~~~
In file included from /usr/local/include/xtensor/xarray.hpp:20:0,
from /usr/local/include/xtensor/xadapt.hpp:20,
from /usr/local/include/xtensor/xnpy.hpp:34,
from /usr/local/include/xtensor-io/xnpz.hpp:30,
from /home/adminlocal/PhD/cpp/mesh-tools/src/IO/fileIO.h:36,
from /home/adminlocal/PhD/cpp/mesh-tools/src/IO/fileIO.cpp:5:
/usr/local/include/xtensor/xcontainer.hpp:578:31: error: void value not ignored as it ought to be
return storage().data();
^
The text was updated successfully, but these errors were encountered:
Trying to dump a boolean array leads to the error below.
The code compiles fine if I replace the
bool
withint
.Is this a bug or am I doing something wrong?
leads to the following error:
The text was updated successfully, but these errors were encountered: