Esempio n. 1
0
void Value::clear()
{
    switch (mType) {
    case Type_String:
        stringPtr()->~String();
        break;
    case Type_Map:
        mapPtr()->~Map<String, Value>();
        break;
    case Type_List:
        listPtr()->~List<Value>();
        break;
    case Type_Custom:
        customPtr()->~shared_ptr<Custom>();
        break;
    default:
        break;
    }

    mType = Type_Invalid;
}
Esempio n. 2
0
 inline void clear() {
     gk_list *l = listPtr();
     cmds.clear();
     l->ncmds = 0;
     l->cmds = nullptr;
 }
Esempio n. 3
0
 void updateList() {
     auto l = listPtr();
     l->ncmds = cmds.size();
     l->cmds = cmds.data();
 }