@@ -32,6 +32,7 @@
32#include <deque>
32#include <deque>
33#include <utility>
33#include <utility>
34#include <stdexcept>
34#include <stdexcept>
35+#include <iso646.h> // mostly for MS Visual Studio compiler
36#define DECLARE_OPERATOR(op, ty, rty) \
37#define DECLARE_OPERATOR(op, ty, rty) \
37 friend auto operator op (const any&, ty) -> rty; \
38 friend auto operator op (const any&, ty) -> rty; \
@@ -328,6 +329,10 @@ class any {
328 DECLARE_COMPARISON_OPERATOR(>)
329 DECLARE_COMPARISON_OPERATOR(>)
329 DECLARE_COMPARISON_OPERATOR(>=)
330 DECLARE_COMPARISON_OPERATOR(>=)
332+ // For MS Visual Studio compiler: broken typed-enum workaround
333+ DECLARE_OPERATOR(==, int, bool)
334+ DECLARE_OPERATOR(!=, int, bool)
331 friend auto operator+(const any&, const any&) -> any;
336 friend auto operator+(const any&, const any&) -> any;
333 DECLARE_OPERATOR(+, long, long)
338 DECLARE_OPERATOR(+, long, long)
@@ -361,6 +366,14 @@ class any {
361 friend auto operator-(const any&) -> any; // unary negate
366 friend auto operator-(const any&) -> any; // unary negate
369+// For MS Visual Studio compiler: broken typed-enum workaround
370+inline auto operator==(const any& lhs, int rhs) -> bool {
371+ return lhs == (long)rhs;
373+inline auto operator!=(const any& lhs, int rhs) -> bool {
374+ return lhs != (long)rhs;
364} // namespace PureScript
377} // namespace PureScript
366#undef DECLARE_OPERATOR
379#undef DECLARE_OPERATOR