Template class for Array. The implementation is fully inlined thanks to the class BaseArray.
- Parameters
-
T | item class |
A | allocator class |
#include "commore/Commore.h"
#include "commore/Error.h"
#include "commore/Array.h"
#include <stdio.h>
CMR_MODULE_DECLARE("EXAMPLE_ARRAY");
CMR_FILE_DECLARE();
using namespace std;
using namespace commore;
void trace_array(
const ArrayInt& l,
const char* label)
{
CMR_INFO("Array: %0") << label;
{
CMR_INFO(" %0") << *i;
}
}
int main(int argc, const char* argv[])
{
int r= 0;
CMR_INFO("Start example Array");
trace_array(numbers, "original");
{
*i *= 2;
}
trace_array(numbers, "new *2");
for (
int j = 0; j < numbers.
size(); j++)
{
numbers[j] *= 3;
}
trace_array(numbers, "new *3");
trace_array(numbers, "new size 10");
return r;
}