File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 55#include " ../include/pgvector/sparsevec.hpp"
66#include " ../include/pgvector/vector.hpp"
77
8+ #if __cplusplus >= 202002L
9+ #include < span>
10+ #endif
11+
812using pgvector::HalfVector;
913using pgvector::SparseVector;
1014using pgvector::Vector;
@@ -16,6 +20,13 @@ void test_vector() {
1620 assert (vec.dimensions () == 3 );
1721}
1822
23+ #if __cplusplus >= 202002L
24+ void test_vector_span () {
25+ auto vec = Vector (std::span<const float >({1 , 2 , 3 }));
26+ assert (vec.dimensions () == 3 );
27+ }
28+ #endif
29+
1930void test_halfvec () {
2031 auto vec = HalfVector ({1 , 2 , 3 });
2132 assert (vec.dimensions () == 3 );
@@ -39,6 +50,9 @@ void test_sparsevec_map() {
3950int main () {
4051 test_pqxx ();
4152 test_vector ();
53+ #if __cplusplus >= 202002L
54+ test_vector_span ();
55+ #endif
4256 test_halfvec ();
4357 test_sparsevec ();
4458 return 0 ;
You can’t perform that action at this time.
0 commit comments