@@ -47,7 +47,7 @@ template <> struct string_traits<pgvector::Vector> {
4747 }
4848
4949 static std::string_view to_buf (std::span<char > buf, const pgvector::Vector& value, ctx c = {}) {
50- auto values = static_cast <std::vector< float >>(value);
50+ auto values = static_cast <std::span< const float >>(value);
5151
5252 // important! size_buffer cannot throw an exception on overflow
5353 // so perform this check before writing any data
@@ -71,7 +71,7 @@ template <> struct string_traits<pgvector::Vector> {
7171 }
7272
7373 static size_t size_buffer (const pgvector::Vector& value) noexcept {
74- auto values = static_cast <std::vector< float >>(value);
74+ auto values = static_cast <std::span< const float >>(value);
7575
7676 // cannot throw an exception here on overflow
7777 // so throw in into_buf
@@ -111,7 +111,7 @@ template <> struct string_traits<pgvector::HalfVector> {
111111 }
112112
113113 static std::string_view to_buf (std::span<char > buf, const pgvector::HalfVector& value, ctx c = {}) {
114- auto values = static_cast <std::vector< float >>(value);
114+ auto values = static_cast <std::span< const float >>(value);
115115
116116 // important! size_buffer cannot throw an exception on overflow
117117 // so perform this check before writing any data
@@ -135,7 +135,7 @@ template <> struct string_traits<pgvector::HalfVector> {
135135 }
136136
137137 static size_t size_buffer (const pgvector::HalfVector& value) noexcept {
138- auto values = static_cast <std::vector< float >>(value);
138+ auto values = static_cast <std::span< const float >>(value);
139139
140140 // cannot throw an exception here on overflow
141141 // so throw in into_buf
0 commit comments