Commore List containers are implemented as doubly-linked lists on std::list model Many methodes are very closed Commore List are builtin types, even if List is defined as a template only following data type can be instantiaded in the commore::List template Bool, Int, Long, Float, Double, AString, String, Blob, Tuple, ArrayBool, ArrayInt, ArrayFloat, ArrayDouble Please use the types defined in Type.h Do not use this template for non commore object. STL containers will be more suitable.
#include "commore/Commore.h"
#include "commore/List.h"
#include "commore/Error.h"
#include <stdio.h>
CMR_MODULE_DECLARE("EXAMPLE_LIST");
CMR_FILE_DECLARE();
using namespace std;
using namespace commore;
void trace_list(
const ListAString& l,
const char* label)
{
CMR_INFO("List: %0") << label;
{
CMR_INFO(" %0") << *i;
}
}
int main(int argc, const char* argv[])
{
int r= 0;
CMR_INFO("Start example List");
trace_list(fruits, "original");
{
{
if (*ifruit == "orange" || *ifruit == "apple")
{
ifruit.erase();
} else {
ifruit++;
}
}
}
trace_list(fruits, "no apple, no orange");
return r;
}