Skip to content

Commit b8361d8

Browse files
committed
fix universal: hint to use formats/serialize/boost_uuid.hpp
commit_hash:9562ce349ff7355b607e6ab325f66e6e93667f8d
1 parent b71e4d6 commit b8361d8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

universal/include/userver/formats/serialize/write_to_stream.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
#include <userver/formats/common/meta.hpp>
1616

17+
namespace boost::uuids {
18+
struct uuid;
19+
}
20+
1721
USERVER_NAMESPACE_BEGIN
1822

1923
namespace utils::impl::strong_typedef {
@@ -85,6 +89,10 @@ WriteToStream(const T& value, StringBuilder& sw) {
8589
if constexpr (meta::kIsMap<T>) {
8690
impl::WriteToStreamDict(value, sw);
8791
} else if constexpr (meta::kIsRange<T>) {
92+
static_assert(
93+
!std::is_same_v<T, boost::uuids::uuid>,
94+
"Include <userver/formats/serialize/boost_uuid.hpp> to serialize 'boost::uuids::uuid"
95+
);
8896
static_assert(
8997
!meta::kIsRecursiveRange<T>,
9098
"Trying to log a recursive range, which can be dangerous. "

0 commit comments

Comments
 (0)