Sha256: 4eb6d458a3607620c683beb96030e472ca50065b788c0d4a3dd39d15062f5b3e
Contents?: true
Size: 1.15 KB
Versions: 36
Compression:
Stored size: 1.15 KB
Contents
#ifndef Rice__detail__from_ruby__ipp_ #define Rice__detail__from_ruby__ipp_ #include "../Data_Type.hpp" #include "../String.hpp" #include "demangle.hpp" #include <typeinfo> template<typename T> T Rice::detail::from_ruby_<T>:: convert(Rice::Object x) { if(rb_type(x.value()) == T_DATA) { return *Data_Type<T>::from_ruby(x); } else { std::string s("Unable to convert "); s += x.class_of().name().c_str(); s += " to "; s += demangle(typeid(T).name()); throw std::invalid_argument(s.c_str()); } } template<typename T> T * Rice::detail::from_ruby_<T *>:: convert(Rice::Object x) { if(rb_type(x.value()) == T_DATA) { return Data_Type<T>::from_ruby(x); } else { std::string s("Unable to convert "); s += x.class_of().name().c_str(); s += " to "; s += demangle(typeid(T *).name()); throw std::invalid_argument(s.c_str()); } } template<typename T> T const * Rice::detail::from_ruby_<T const *>:: convert(Rice::Object x) { return from_ruby<T *>(x); } template<typename T> T & Rice::detail::from_ruby_<T &>:: convert(Rice::Object x) { return *from_ruby<T *>(x); } #endif // Rice__detail__from_ruby__ipp_
Version data entries
36 entries across 36 versions & 6 rubygems