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 5
5
#include " ../include/pgvector/sparsevec.hpp"
6
6
#include " ../include/pgvector/vector.hpp"
7
7
8
+ #if __cplusplus >= 202002L
9
+ #include < span>
10
+ #endif
11
+
8
12
using pgvector::HalfVector;
9
13
using pgvector::SparseVector;
10
14
using pgvector::Vector;
@@ -16,6 +20,13 @@ void test_vector() {
16
20
assert (vec.dimensions () == 3 );
17
21
}
18
22
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
+
19
30
void test_halfvec () {
20
31
auto vec = HalfVector ({1 , 2 , 3 });
21
32
assert (vec.dimensions () == 3 );
@@ -39,6 +50,9 @@ void test_sparsevec_map() {
39
50
int main () {
40
51
test_pqxx ();
41
52
test_vector ();
53
+ #if __cplusplus >= 202002L
54
+ test_vector_span ();
55
+ #endif
42
56
test_halfvec ();
43
57
test_sparsevec ();
44
58
return 0 ;
You can’t perform that action at this time.
0 commit comments