File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
3232 add_executable (test test /halfvec_test.cpp test /main.cpp test /pqxx_test.cpp test /sparsevec_test.cpp test /vector_test.cpp )
3333 target_link_libraries (test PRIVATE libpqxx::pqxx pgvector::pgvector )
3434 if (NOT MSVC )
35- target_compile_options (test PRIVATE -Wall -Wextra -Wpedantic -Werror )
35+ target_compile_options (test PRIVATE -Wall -Wextra -Wpedantic -Wconversion - Werror )
3636 endif ()
3737 endif ()
3838endif ()
Original file line number Diff line number Diff line change @@ -33,11 +33,12 @@ class SparseVector {
3333
3434 // / Creates a sparse vector from a span.
3535 explicit SparseVector (std::span<const float > value) {
36- dimensions_ = value.size ();
36+ // TODO throw exception
37+ dimensions_ = static_cast <int >(value.size ());
3738 for (size_t i = 0 ; i < value.size (); i++) {
3839 float v = value[i];
3940 if (v != 0 ) {
40- indices_.push_back (i );
41+ indices_.push_back (static_cast < int >(i) );
4142 values_.push_back (v);
4243 }
4344 }
You can’t perform that action at this time.
0 commit comments