git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge branch 'pure11' of github.com:pure11/purescript into pure11-0.8
ecfaed3Andy Arvanitis
pcc/include/map_key.hh+2
@@ -15,6 +15,8 @@
15#ifndef PS_MapKey_HH
15#ifndef PS_MapKey_HH
16#define PS_MapKey_HH
16#define PS_MapKey_HH
17
17
18+#include <cstring>
19+
18namespace PureScript {
20namespace PureScript {
19
21
20 struct map_key_t {
22 struct map_key_t {
pcc/include/purescript.cc+1−1
@@ -136,7 +136,7 @@ any::~any() {
136 template auto any::cast<any::vector>() const -> const vector&;
136 template auto any::cast<any::vector>() const -> const vector&;
137
137
138
138
139− auto any::operator()(const any arg) const -> any {
139+ auto any::operator()(const any& arg) const -> any {
140 if (type == Type::Function) {
140 if (type == Type::Function) {
141 return (*f)(arg);
141 return (*f)(arg);
142 }
142 }
pcc/include/purescript.hh+3−2
@@ -141,7 +141,8 @@ class any {
141 any(const shared<fn>& val) : type(Type::Function), f(val) {}
141 any(const shared<fn>& val) : type(Type::Function), f(val) {}
142 any(shared<fn>&& val) : type(Type::Function), f(std::move(val)) {}
142 any(shared<fn>&& val) : type(Type::Function), f(std::move(val)) {}
143
143
144− template <typename T>
144+ template <typename T,
145+ typename = typename std::enable_if<!std::is_same<any,T>::value>::type>
145 any(const T& val, typename std::enable_if<std::is_assignable<fn,T>::value>::type* = 0)
146 any(const T& val, typename std::enable_if<std::is_assignable<fn,T>::value>::type* = 0)
146 : type(Type::Function), f(make_shared<fn>(val)) {}
147 : type(Type::Function), f(make_shared<fn>(val)) {}
147
148
@@ -230,7 +231,7 @@ class any {
230 return nullptr;
231 return nullptr;
231 }
232 }
232
233
233− auto operator()(const any) const -> any;
234+ auto operator()(const any&) const -> any;
234
235
235 auto operator()(const as_thunk) const -> const any&;
236 auto operator()(const as_thunk) const -> const any&;
236
237