git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge remote-tracking branch 'pure11/pure11' into native
40f10b9Andy Arvanitis
pcc/runtime/purescript.hh+7−4
@@ -449,13 +449,16 @@ inline auto cast(const any& a) ->
449
449
450template <typename T>
450template <typename T>
451inline auto cast(const any& a) ->
451inline auto cast(const any& a) ->
452− typename std::enable_if<std::is_same<T, any::array>::value, const T&>::type {
452+ typename std::enable_if<std::is_same<T, string>::value ||
453+ std::is_same<T, any::array>::value, const T&>::type {
453 return a;
454 return a;
454}
455}
455
456
457+template <typename T,
456−template <typename T, typename = typename std::enable_if<std::is_class<T>::value>::type>
458+ typename = typename std::enable_if<std::is_class<T>::value &&
459+ !std::is_same<T,string>::value &&
460+ !std::is_same<T,any::array>::value>::type>
457−inline auto cast(const any& a) ->
461+inline auto cast(const any& a) -> T& {
458− typename std::enable_if<!std::is_same<T, any::array>::value, T&>::type {
459 return *static_cast<T*>(a.extractPointer(IF_DEBUG(Private::TagHelper<T>::tag)));
462 return *static_cast<T*>(a.extractPointer(IF_DEBUG(Private::TagHelper<T>::tag)));
460}
463}
461
464