| 1033 | |
| 1034 | template <typename T> |
| 1035 | inline void assign_sugar_expression( const T& x ) { |
| 1036 | R_xlen_t n = size() ; |
| 1037 | if( n == x.size() ){ |
| 1038 | // just copy the data |
| 1039 | import_expression<T>(x, n ) ; |
| 1040 | } else{ |
| 1041 | // different size, so we change the memory |
| 1042 | Shield<SEXP> wrapped(wrap(x)); |
| 1043 | Shield<SEXP> casted(r_cast<RTYPE>(wrapped)); |
| 1044 | Storage::set__(casted); |
| 1045 | } |
| 1046 | } |
| 1047 | |
| 1048 | // sugar |
| 1049 | template <typename T> |