Skip to content

Commit

Permalink
MSVC: Fixed FLEncoderImpl
Browse files Browse the repository at this point in the history
Stop using nonstandard `__typeof`; replace with `decltype`
  • Loading branch information
snej committed Aug 27, 2024
1 parent a74d037 commit 6434012
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Fleece/API_Impl/Fleece+ImplGlue.hh
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace fleece::impl {
template <typename CALLBACK>
auto do_(CALLBACK const& callback) {
return std::visit([&](auto& e) {
if constexpr (std::is_pointer_v<__typeof(e)>)
if constexpr (std::is_pointer_v<std::remove_reference_t<decltype(e)>>)
return callback(*e);
else
return callback(e);
Expand Down
8 changes: 4 additions & 4 deletions Fleece/Core/Builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ namespace fleece::impl::builder {
}
#endif
std::visit([&](auto val) {
if constexpr (!is_same_v<__typeof(val), monostate> && !is_same_v<__typeof(val), const void*>)
if constexpr (!is_same_v<decltype(val), monostate> && !is_same_v<decltype(val), const void*>)
inSlot.set(val);
}, p);
return true;
Expand Down Expand Up @@ -299,11 +299,11 @@ namespace fleece::impl::builder {
if (key)
_encoder.writeKey(key);
std::visit([&](auto val) {
if constexpr (is_same_v<__typeof(val), monostate>) {
if constexpr (is_same_v<decltype(val), monostate>) {
//
} else if constexpr (is_same_v<__typeof(val), bool>) {
} else if constexpr (is_same_v<decltype(val), bool>) {
_encoder.writeBool(val);
} else if constexpr (is_same_v<__typeof(val), const void*>) {
} else if constexpr (is_same_v<decltype(val), const void*>) {
#ifdef __APPLE__
_encoder.writeCF(val);
#endif
Expand Down

0 comments on commit 6434012

Please sign in to comment.