Skip to content

Commit

Permalink
fix bug lack ormpp namespace when REGISTER_AUTO_KEY
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacyking committed Dec 15, 2023
2 parents b4b0296 + c31105f commit f3c1bf7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
5 changes: 3 additions & 2 deletions iguana/define.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once

#include <array>
#if __cplusplus >= 202002L
#if (defined(_MSC_VER) && _MSC_VER >= 1920 && _MSVC_LANG >= 202002L) || \
(!defined(_MSC_VER) && defined(__cplusplus) && __cplusplus >= 202002L)
#include <bit>
#endif
#include <array>
#include <string>
#include <string_view>
#include <type_traits>
Expand Down
10 changes: 0 additions & 10 deletions iguana/json_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,6 @@ IGUANA_INLINE void skip_ws_no_comments(It &&it, It &&end) {
}
}

inline constexpr auto has_zero = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
return (((chunk - 0x0101010101010101) & ~chunk) & 0x8080808080808080);
};

inline constexpr auto has_qoute = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
return has_zero(
chunk ^
0b0010001000100010001000100010001000100010001000100010001000100010);
};

inline constexpr auto has_escape = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
return has_zero(
chunk ^
Expand Down
11 changes: 10 additions & 1 deletion iguana/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "error_code.h"
#include "reflection.hpp"


namespace iguana {

template <typename T>
Expand Down Expand Up @@ -194,4 +193,14 @@ IGUANA_INLINE void match(It &&it, It &&end) {
}
}

inline constexpr auto has_zero = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
return (((chunk - 0x0101010101010101) & ~chunk) & 0x8080808080808080);
};

inline constexpr auto has_qoute = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
return has_zero(
chunk ^
0b0010001000100010001000100010001000100010001000100010001000100010);
};

} // namespace iguana
12 changes: 1 addition & 11 deletions iguana/xml_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ struct is_cdata_t<xml_cdata_t<T>> : std::true_type {};
template <typename T>
constexpr inline bool cdata_v = is_cdata_t<std::remove_cvref_t<T>>::value;

inline constexpr auto has_zero = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
return (((chunk - 0x0101010101010101) & ~chunk) & 0x8080808080808080);
};

inline constexpr auto has_greater = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
return has_zero(
chunk ^
Expand Down Expand Up @@ -82,15 +78,9 @@ inline constexpr auto has_equal = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
0b0011110100111101001111010011110100111101001111010011110100111101);
};

inline constexpr auto has_qoute = [](uint64_t chunk) IGUANA__INLINE_LAMBDA {
return has_zero(
chunk ^
0b0010001000100010001000100010001000100010001000100010001000100010);
};

template <typename It>
IGUANA_INLINE void skip_sapces_and_newline(It &&it, It &&end) {
while (it != end && (*it < 33)) {
while (it != end && (static_cast<uint8_t>(*it) < 33)) {
++it;
}
}
Expand Down
2 changes: 1 addition & 1 deletion iguana/yaml_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace iguana {
// return true when it==end
template <typename It>
IGUANA_INLINE bool skip_space_till_end(It &&it, It &&end) {
while (it != end && *it < 33) ++it;
while (it != end && (static_cast<uint8_t>(*it) < 33)) ++it;
return it == end;
}

Expand Down

0 comments on commit f3c1bf7

Please sign in to comment.