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+
3043namespace bsoncxx {
3144namespace v_noabi {
3245namespace 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
324328template <typename T>
325- detail::requires_t <bool , is_bson_view_compatible<T>> //
329+ detail::requires_t <bool , detail:: is_bson_view_compatible<T>> //
326330operator ==(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
331335template <typename T>
332- detail::requires_t <bool , is_bson_view_compatible<T>> //
336+ detail::requires_t <bool , detail:: is_bson_view_compatible<T>> //
333337operator ==(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
338342template <typename T>
339- detail::requires_t <bool , is_bson_view_compatible<T>> //
343+ detail::requires_t <bool , detail:: is_bson_view_compatible<T>> //
340344operator !=(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
345349template <typename T>
346- detail::requires_t <bool , is_bson_view_compatible<T>> //
350+ detail::requires_t <bool , detail:: is_bson_view_compatible<T>> //
347351operator !=(T&& lhs, const bson_value::view& rhs) {
348352 return bson_value::view{std::forward<T>(lhs)} != rhs;
349353}
0 commit comments