Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
71f0e61
Shorthand for trailing return type, noexcept, and single-return-state…
vector-of-bool Nov 8, 2023
f5e1d02
Some additional traits: decay_copy and rank<>
vector-of-bool Nov 8, 2023
f79efdb
New operators.hpp utilities
vector-of-bool Nov 8, 2023
ff488e3
Iterator utilities
vector-of-bool Nov 9, 2023
155f528
We don't need to start_mongod for the simple compile tasks
vector-of-bool Nov 9, 2023
e3575fa
A new set of macros for concise diagnostic controls
vector-of-bool Nov 10, 2023
fb1ac46
Disable warnings about void-dereference on Clang
vector-of-bool Nov 10, 2023
41d6765
Reorganize macro definitions
vector-of-bool Nov 13, 2023
3868e35
Fix: malformed pragmas on MSVC
vector-of-bool Nov 14, 2023
c7350d3
A small amount of std::ranges from the future
vector-of-bool Nov 14, 2023
c13e052
Bring our own std::string_view
vector-of-bool Nov 14, 2023
f2bb2fb
Avoid warnings about "unsecure stdlib" code
vector-of-bool Nov 16, 2023
fbd5535
Tweak definition of is_equality_comparable
vector-of-bool Nov 29, 2023
5740433
decay_copy is no longer needed (yet)
vector-of-bool Nov 29, 2023
b318f62
Check for MSVC's version macro
vector-of-bool Nov 29, 2023
ff7978d
No ADL-only data()
vector-of-bool Nov 29, 2023
4aeae1d
Remove c_str(), tweak "string-like" detection
vector-of-bool Nov 29, 2023
536fc05
Minor spelling and tests
vector-of-bool Nov 29, 2023
b973270
Merge branch 'master' into own-string_view.2
vector-of-bool Nov 29, 2023
39dc524
MSVC 19.10 lies about C++14 constexpr
vector-of-bool Nov 30, 2023
d67f942
Test and fixup for ADL lookup on VS 2015
vector-of-bool Nov 30, 2023
c1a7997
Cleaner size() constraint
vector-of-bool Nov 30, 2023
40f544f
unreachable_sentinel, plus support for arg swapping in equality_opera…
vector-of-bool Nov 30, 2023
e083ca5
Qualify test names in string_view tests
vector-of-bool Nov 30, 2023
43c7924
Bring our own algorithm.hpp
vector-of-bool Dec 4, 2023
09961a8
Implement find() and contains() from string_view
vector-of-bool Dec 4, 2023
e9e78ea
Merge branch 'master' into own-string_view.2
vector-of-bool Dec 4, 2023
1f3c509
Remove newer .clang-foramt option, document internal macros as internal
vector-of-bool Dec 4, 2023
67af4b3
Calm linter
vector-of-bool Dec 6, 2023
2c61f8d
Sort file lists
vector-of-bool Dec 8, 2023
7d31688
Remove string_view assertions
vector-of-bool Dec 8, 2023
bff45a1
Add/update copyright banners
vector-of-bool Dec 8, 2023
b502632
Tweak is_dereferencable to test lvalues
vector-of-bool Dec 8, 2023
347228a
Tweak some macro names/scoping
vector-of-bool Dec 8, 2023
af787d5
Updating casing on macro names
vector-of-bool Dec 8, 2023
7fb5dc3
Exclude some files from Doxygen coverage
vector-of-bool Dec 8, 2023
cb8f1d9
[foldme] macro case updates
vector-of-bool Dec 8, 2023
b89c040
Simpler iterator_concept_t
vector-of-bool Dec 8, 2023
4aad0eb
Explain the inclusion of std::contiguous_iterator_tag
vector-of-bool Dec 8, 2023
2b9291d
Update #include style
vector-of-bool Dec 8, 2023
cf495de
Qualify bsoncxx::detail references
vector-of-bool Dec 8, 2023
c7168a5
Spelling/wording tweaks
vector-of-bool Dec 11, 2023
f59fbea
Remove C++20+ string-view APIs
vector-of-bool Dec 11, 2023
348fa3e
More testing and fixes for fencepost errors in string searches
vector-of-bool Dec 11, 2023
b5398c1
Drop range constructs. Test+fix some more edge cases in string search…
vector-of-bool Dec 12, 2023
2a06503
Drop equality requirement
vector-of-bool Dec 12, 2023
c948aa6
Merge branch 'master' into own-string_view.2
vector-of-bool Dec 14, 2023
ffc332e
More review and cleanup + spec matching
vector-of-bool Dec 14, 2023
3608164
More careful conversion to/from std types
vector-of-bool Dec 14, 2023
87bc426
ClangFormat changes its mind in the future, +stray noexcepts
vector-of-bool Dec 15, 2023
947d289
Fix: Don't instantiate unused trait operands
vector-of-bool Dec 12, 2023
76e989e
Ordering traits: is_totally_ordered
vector-of-bool Dec 12, 2023
31410b8
Bring our own optional<T>
vector-of-bool Dec 12, 2023
85c46a3
Minor formatting
vector-of-bool Dec 12, 2023
ae151f0
Drop C++23 APIs
vector-of-bool Dec 12, 2023
551451e
Merge branch 'master' into own-optional
vector-of-bool Jan 4, 2024
9663852
Merge branch 'master' into own-optional
vector-of-bool Jan 4, 2024
c9252af
Drop separate TU for optional runtime checks
vector-of-bool Jan 8, 2024
9f050c6
push+pop HAVE_STDLIB macro
vector-of-bool Jan 8, 2024
6dd3248
Use qualified names for bsoncxx details
vector-of-bool Jan 8, 2024
aaecaba
Remove some unused test items
vector-of-bool Jan 17, 2024
dc6ff74
Merge branch 'master' into own-optional
vector-of-bool Jan 17, 2024
6e1e370
Test and fix converting move constructors
vector-of-bool Jan 30, 2024
6dfdf62
Missing emplacement constructor for init-list
vector-of-bool Jan 30, 2024
2979a6e
Fix return value of swapped compare operators
vector-of-bool Jan 30, 2024
02390e6
Fix emplace() signatures
vector-of-bool Jan 30, 2024
ecac1be
Clean up the BSONCXX_FWD macro
vector-of-bool Jan 30, 2024
d456820
Formatter for strong_ordering
vector-of-bool Jan 30, 2024
c342ee3
Add/fix:
vector-of-bool Jan 30, 2024
46d87db
Define hash<optional<T>>
vector-of-bool Jan 30, 2024
2852651
Swap detection for C++11
vector-of-bool Jan 30, 2024
bf1a6b0
Merge branch 'master' into own-optional
vector-of-bool Jan 30, 2024
452f9d7
Workaround for MSVC weirdness
vector-of-bool Jan 31, 2024
1e9c20e
AppleClang also lacks LWG2543
vector-of-bool Feb 1, 2024
47336c2
Exhaustic relation checks, remove stray line
vector-of-bool Feb 5, 2024
51b4273
Fix optional<const T>
vector-of-bool Feb 5, 2024
8e4fd82
Fix noexcept spec for optional swap
vector-of-bool Feb 5, 2024
0c0e370
Fix hash to match behavior of std::optional
vector-of-bool Feb 5, 2024
2ee8b0c
Inline reversed swap
vector-of-bool Feb 5, 2024
0ee25ca
Many more test cases
vector-of-bool Feb 5, 2024
abd8aa2
Make nullopt_t non-aggregate
vector-of-bool Feb 5, 2024
ff54bdf
Shift position of macro manipulations
vector-of-bool Feb 5, 2024
017696f
Ensure optional.hpp is included first in its test case
vector-of-bool Feb 5, 2024
6dd22a2
Fix warnings and tests for opt conversion
vector-of-bool Feb 6, 2024
b4196f3
No conversion warning
vector-of-bool Feb 6, 2024
feaaa16
Fix: compare_three_way name lookup differences between compilers
vector-of-bool Feb 6, 2024
5723a66
Unused header
vector-of-bool Feb 9, 2024
4eddb46
Minor PR tweaks
vector-of-bool Feb 9, 2024
c61402c
Merge branch 'master' into own-optional
vector-of-bool Feb 9, 2024
c3b1646
fmt tweak
vector-of-bool Feb 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@ static_assert(false, "BSONCXX_ENUM must be undef'ed");
#pragma pop_macro("BSONCXX_IF_GCC")
#pragma pop_macro("BSONCXX_IF_CLANG")
#pragma pop_macro("BSONCXX_IF_GNU_LIKE")

#pragma pop_macro("BSONCXX_FWD")
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
#undef _bsoncxxDisableWarningImpl_for_MSVC
#pragma push_macro("_bsoncxxDisableWarningImpl_for_GNU")
#undef _bsoncxxDisableWarningImpl_for_GNU
#pragma push_macro("BSONCXX_FWD")
#undef BSONCXX_FWD

// compiler.hpp
#pragma push_macro("BSONCXX_INLINE")
Expand Down
3 changes: 3 additions & 0 deletions src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,6 @@

#define _bsoncxxDisableWarningImpl_for_MSVC(...) \
BSONCXX_IF_MSVC(BSONCXX_PRAGMA(warning(disable : __VA_ARGS__)))

#define BSONCXX_FWD(...) static_cast<decltype(__VA_ARGS__)&&>(__VA_ARGS__)

48 changes: 45 additions & 3 deletions src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/operators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ class strong_ordering {
DEFOP(<=);
DEFOP(>=);
#pragma pop_macro("DEFOP")

// nonstd: Swap greater/less values
constexpr strong_ordering inverted() const noexcept {
return *this < 0 ? greater : *this > 0 ? less : *this;
}
};

#pragma push_macro("INLINE_VAR")
Expand Down Expand Up @@ -151,8 +156,8 @@ struct compare_three_way {
typename R,
typename = decltype(tag_invoke(
std::declval<compare_three_way>(), std::declval<L>(), std::declval<R>()))>
constexpr strong_ordering impl(L const& l, R const& r, rank<2>) const {
return tag_invoke(*this, l, r);
constexpr static strong_ordering impl(L const& l, R const& r, rank<2>) {
return tag_invoke(compare_three_way{}, l, r);
}

template <typename L, typename R>
Expand All @@ -165,19 +170,56 @@ struct compare_three_way {
* implementation of tag_invoke(compare_three_way, l, r)
*/
struct ordering_operators {
template <typename L, typename R>
constexpr static auto impl(const L& l, const R& r, rank<1>)
BSONCXX_RETURNS(tag_invoke(compare_three_way{}, l, r));

template <typename L, typename R>
constexpr static auto impl(const L& l, const R& r, rank<0>)
BSONCXX_RETURNS(tag_invoke(compare_three_way{}, r, l).inverted());

#pragma push_macro("DEFOP")
#undef DEFOP
#define DEFOP(Oper) \
template <typename L, typename R> \
constexpr friend auto operator Oper(const L& l, const R& r) \
BSONCXX_RETURNS(tag_invoke(compare_three_way{}, l, r) Oper 0)
BSONCXX_RETURNS(ordering_operators::impl(l, r, rank<1>{}) Oper 0)
DEFOP(<);
DEFOP(>);
DEFOP(<=);
DEFOP(>=);
#pragma pop_macro("DEFOP")
};

template <typename T, typename U>
std::false_type is_partially_ordered_with_f(rank<0>);

template <typename T, typename U>
auto is_partially_ordered_with_f(rank<1>,
const T& l = soft_declval<T>(),
const U& r = soft_declval<U>()) //
-> true_t<decltype(l > r),
decltype(l < r),
decltype(l >= r),
decltype(l <= r),
decltype(r < l),
decltype(r > l),
decltype(r <= l),
decltype(r >= l)>;

template <typename T, typename U>
struct is_partially_ordered_with : decltype(is_partially_ordered_with_f<T, U>(rank<1>{})) {};

template <typename T>
struct is_totally_ordered
: conjunction<is_equality_comparable<T>, is_partially_ordered_with<T, T>> {};

template <typename T, typename U>
struct is_totally_ordered_with : conjunction<is_totally_ordered<T>,
is_totally_ordered<U>,
is_equality_comparable<T, U>,
is_partially_ordered_with<T, U>> {};

} // namespace detail
} // namespace bsoncxx

Expand Down
Loading