Skip to content

Commit a32f94b

Browse files
authored
Move stray bson_value::view type traits into detail namespace (#1263)
1 parent b31f0d4 commit a32f94b

File tree

1 file changed

+17
-13
lines changed
  • src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value

1 file changed

+17
-13
lines changed

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/view.hpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@
2727

2828
#include <bsoncxx/config/prelude.hpp>
2929

30+
namespace bsoncxx {
31+
namespace detail {
32+
33+
template <typename T>
34+
using is_bson_view_compatible =
35+
detail::conjunction<std::is_constructible<bsoncxx::v_noabi::types::bson_value::view, T>,
36+
detail::negation<detail::disjunction<
37+
detail::is_alike<T, bsoncxx::v_noabi::types::bson_value::view>,
38+
detail::is_alike<T, bsoncxx::v_noabi::types::bson_value::value>>>>;
39+
40+
} // namespace detail
41+
} // namespace bsoncxx
42+
3043
namespace bsoncxx {
3144
namespace v_noabi {
3245
namespace types {
@@ -303,15 +316,6 @@ class view {
303316
};
304317
};
305318

306-
template <typename T>
307-
using is_bson_view_compatible = detail::conjunction<
308-
std::is_constructible<bson_value::view, T>,
309-
detail::negation<detail::disjunction<detail::is_alike<T, bson_value::view>,
310-
detail::is_alike<T, bson_value::value>>>>;
311-
312-
template <typename T>
313-
using not_view = is_bson_view_compatible<T>;
314-
315319
///
316320
/// Compares a view with a type representable as a view.
317321
///
@@ -322,28 +326,28 @@ using not_view = is_bson_view_compatible<T>;
322326

323327
/// @relatesalso bsoncxx::v_noabi::types::bson_value::view
324328
template <typename T>
325-
detail::requires_t<bool, is_bson_view_compatible<T>> //
329+
detail::requires_t<bool, detail::is_bson_view_compatible<T>> //
326330
operator==(const bson_value::view& lhs, T&& rhs) {
327331
return lhs == bson_value::view{std::forward<T>(rhs)};
328332
}
329333

330334
/// @relatesalso bsoncxx::v_noabi::types::bson_value::view
331335
template <typename T>
332-
detail::requires_t<bool, is_bson_view_compatible<T>> //
336+
detail::requires_t<bool, detail::is_bson_view_compatible<T>> //
333337
operator==(T&& lhs, const bson_value::view& rhs) {
334338
return bson_value::view{std::forward<T>(lhs)} == rhs;
335339
}
336340

337341
/// @relatesalso bsoncxx::v_noabi::types::bson_value::view
338342
template <typename T>
339-
detail::requires_t<bool, is_bson_view_compatible<T>> //
343+
detail::requires_t<bool, detail::is_bson_view_compatible<T>> //
340344
operator!=(const bson_value::view& lhs, T&& rhs) {
341345
return lhs != bson_value::view{std::forward<T>(rhs)};
342346
}
343347

344348
/// @relatesalso bsoncxx::v_noabi::types::bson_value::view
345349
template <typename T>
346-
detail::requires_t<bool, is_bson_view_compatible<T>> //
350+
detail::requires_t<bool, detail::is_bson_view_compatible<T>> //
347351
operator!=(T&& lhs, const bson_value::view& rhs) {
348352
return bson_value::view{std::forward<T>(lhs)} != rhs;
349353
}

0 commit comments

Comments
 (0)