Mercurial > octave-nkf
comparison src/ov-base-scalar.cc @ 10670:654fbde5dceb
make cellfun's fast scalar collection mechanism public
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 28 May 2010 12:28:06 +0200 |
parents | ffe28cdc6fe2 |
children | 7fa044155982 |
comparison
equal
deleted
inserted
replaced
10669:cab3b148d4e4 | 10670:654fbde5dceb |
---|---|
152 { | 152 { |
153 indent (os); | 153 indent (os); |
154 os << name << " = "; | 154 os << name << " = "; |
155 return false; | 155 return false; |
156 } | 156 } |
157 | |
158 template <class ST> | |
159 bool | |
160 octave_base_scalar<ST>::fast_elem_insert_self (void *where, builtin_type_t btyp) const | |
161 { | |
162 | |
163 // Don't use builtin_type () here to avoid an extra VM call. | |
164 if (btyp == class_to_btyp<ST>::btyp) | |
165 { | |
166 *(reinterpret_cast<ST *>(where)) = scalar; | |
167 return true; | |
168 } | |
169 else | |
170 return false; | |
171 } |