Skip to content

Commit ba7d195

Browse files
committed
json(Simple): fix int64/long long constructor redeclaration
1 parent d50c665 commit ba7d195

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

include/vix/json/Simple.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,24 @@ namespace vix::json
137137
/// @brief Construct integer from std::int64_t.
138138
token(std::int64_t i) : v(i) {}
139139

140+
#if !std::is_same_v<std::int64_t, long long>
140141
/**
141142
* @brief Construct integer from long long.
142143
*
143144
* This exists to avoid overload ambiguity on platforms where std::int64_t is long.
144145
*/
145146
token(long long i) : v(static_cast<std::int64_t>(i)) {}
147+
#endif
146148

149+
#if !std::is_same_v<std::uint64_t, unsigned long long>
147150
/**
148151
* @brief Construct integer from unsigned long long.
149152
*
150153
* Stored as int64. Values above INT64_MAX will wrap. This is intentional for
151154
* a minimal internal model. If you need full uint64 fidelity, store as string.
152155
*/
153156
token(unsigned long long u) : v(static_cast<std::int64_t>(u)) {}
157+
#endif
154158

155159
/**
156160
* @brief Construct floating point.

0 commit comments

Comments
 (0)