Rollback template alias, not supported in gcc 4.6

This commit is contained in:
Jason Turner
2014-09-19 21:46:52 -06:00
parent 93c1cfde99
commit 81184cbbd7
2 changed files with 15 additions and 8 deletions

View File

@@ -86,7 +86,7 @@ namespace chaiscript
#pragma warning(disable : 4127) #pragma warning(disable : 4127)
#endif #endif
if (std::is_polymorphic<Bare_Type<Type>>::value && t_conversions) if (std::is_polymorphic<typename detail::Bare_Type<Type>::type>::value && t_conversions)
{ {
try { try {
// std::cout << "trying an up conversion " << typeid(Type).name() << std::endl; // std::cout << "trying an up conversion " << typeid(Type).name() << std::endl;

View File

@@ -16,8 +16,15 @@
namespace chaiscript namespace chaiscript
{ {
template<typename T> namespace detail
using Bare_Type = typename std::remove_cv<typename std::remove_pointer<typename std::remove_reference<T>::type>::type>::type; {
template<typename T>
struct Bare_Type
{
typedef typename std::remove_cv<typename std::remove_pointer<typename std::remove_reference<T>::type>::type>::type type;
};
}
/// \brief Compile time deduced information about a type /// \brief Compile time deduced information about a type
class Type_Info class Type_Info
@@ -145,7 +152,7 @@ namespace chaiscript
std::is_void<T>::value, std::is_void<T>::value,
std::is_arithmetic<T>::value && !std::is_same<typename std::remove_const<T>::type, bool>::value, std::is_arithmetic<T>::value && !std::is_same<typename std::remove_const<T>::type, bool>::value,
&typeid(T), &typeid(T),
&typeid(Bare_Type<T>)); &typeid(typename Bare_Type<T>::type));
} }
}; };
@@ -160,7 +167,7 @@ namespace chaiscript
std::is_void<T>::value, std::is_void<T>::value,
std::is_arithmetic<T>::value && !std::is_same<typename std::remove_const<T>::type, bool>::value, std::is_arithmetic<T>::value && !std::is_same<typename std::remove_const<T>::type, bool>::value,
&typeid(std::shared_ptr<T> ), &typeid(std::shared_ptr<T> ),
&typeid(Bare_Type<T>)); &typeid(typename Bare_Type<T>::type));
} }
}; };
@@ -175,7 +182,7 @@ namespace chaiscript
std::is_void<T>::value, std::is_void<T>::value,
std::is_arithmetic<T>::value && !std::is_same<typename std::remove_const<T>::type, bool>::value, std::is_arithmetic<T>::value && !std::is_same<typename std::remove_const<T>::type, bool>::value,
&typeid(const std::shared_ptr<T> &), &typeid(const std::shared_ptr<T> &),
&typeid(Bare_Type<T>)); &typeid(typename Bare_Type<T>::type));
} }
}; };
@@ -190,7 +197,7 @@ namespace chaiscript
std::is_void<T>::value, std::is_void<T>::value,
std::is_arithmetic<T>::value && !std::is_same<typename std::remove_const<T>::type, bool>::value, std::is_arithmetic<T>::value && !std::is_same<typename std::remove_const<T>::type, bool>::value,
&typeid(std::reference_wrapper<T> ), &typeid(std::reference_wrapper<T> ),
&typeid(Bare_Type<T>)); &typeid(typename Bare_Type<T>::type));
} }
}; };
@@ -205,7 +212,7 @@ namespace chaiscript
std::is_void<T>::value, std::is_void<T>::value,
std::is_arithmetic<T>::value && !std::is_same<typename std::remove_const<T>::type, bool>::value, std::is_arithmetic<T>::value && !std::is_same<typename std::remove_const<T>::type, bool>::value,
&typeid(const std::reference_wrapper<T> &), &typeid(const std::reference_wrapper<T> &),
&typeid(Bare_Type<T>)); &typeid(typename Bare_Type<T>::type));
} }
}; };