Skip to content

Commit 62f4b30

Browse files
Inline pqxx type_name variables (#6)
avoids ODR violations and makes library much easier to integrate into larger projects.
1 parent 320f97f commit 62f4b30

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/pgvector/pqxx.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/// @cond
2222

2323
namespace pqxx {
24-
template <> std::string const type_name<pgvector::Vector>{"vector"};
24+
template <> inline std::string const type_name<pgvector::Vector>{"vector"};
2525

2626
template <> struct nullness<pgvector::Vector> : pqxx::no_null<pgvector::Vector> {};
2727

@@ -66,7 +66,7 @@ template <> struct string_traits<pgvector::Vector> {
6666
}
6767
};
6868

69-
template <> std::string const type_name<pgvector::HalfVector>{"halfvec"};
69+
template <> inline std::string const type_name<pgvector::HalfVector>{"halfvec"};
7070

7171
template <> struct nullness<pgvector::HalfVector> : pqxx::no_null<pgvector::HalfVector> {};
7272

@@ -111,7 +111,7 @@ template <> struct string_traits<pgvector::HalfVector> {
111111
}
112112
};
113113

114-
template <> std::string const type_name<pgvector::SparseVector>{"sparsevec"};
114+
template <> inline std::string const type_name<pgvector::SparseVector>{"sparsevec"};
115115

116116
template <> struct nullness<pgvector::SparseVector> : pqxx::no_null<pgvector::SparseVector> {};
117117

0 commit comments

Comments
 (0)