Browse files

Fixed typecasts to work with gcc 4.5

  • Loading branch information...
1 parent d2539ea commit 508ff7d1478f578201b0f88648d5c8eef3d7d059 @Leont committed May 4, 2011
Showing with 3 additions and 3 deletions.
  1. +2 −2 perl++/headers/interpreter.h
  2. +1 −1 perl++/headers/typecasts.h
View
4 perl++/headers/interpreter.h
@@ -5,8 +5,8 @@ namespace perl {
};
}
- template<typename T, typename U> auto typecast_to(U&& u) -> decltype(typecast::typemap<T>::cast_to(u)) {
- return typecast::typemap<T>::cast_to(u);
+ template<typename T, typename U> auto typecast_to(U&& u) -> decltype(typecast::typemap<T>::cast_to(std::forward<U>(u))) {
+ return typecast::typemap<T>::cast_to(std::forward<U>(u));
}
class lock {
View
2 perl++/headers/typecasts.h
@@ -11,7 +11,7 @@ namespace perl {
typedef boost::false_type from_type;
typedef boost::true_type to_type;
- static const T& cast_to(const T& t) {
+ static T cast_to(T&& t) {
return t;
}
static const Scalar::Temp cast_from(Interpreter& interp, const T& t) {

0 comments on commit 508ff7d

Please sign in to comment.