This test program gives an example of the usage of the following classes, functions, and preprocessor macros:
#define AFF_SIMPLEARRAYTEST_CC_VERSION \
"AFF_SIMPLEARRAYTEST_CC V1.4"
#include<iostream>
using std::cout;
using std::endl;
#define FUNC( func ) cout << #func << "=" << func << endl
{
char *s;
if (v) { s="true"; } else { s="false"; }
return(s);
}
{
cout << endl
<< s << endl;
const char* p=s;
while (*p) {
cout << "-";
++p;
}
cout << endl;
}
{
{
cout << "Test SimpleRigidArray" << endl
<< "=====================" << endl;
cout << "SimpleRigidArray<double, 6> A,B(8.);" << endl;
cout << "SimpleRigidArray<int, 4> C,D(100);" << endl;
cout << "const SimpleRigidArray<int, 4> E(D);" << endl;
cout << "SimpleRigidArray<float, 4> F(D);" << endl;
#ifdef ILLEGAL1
#endif
#ifdef ILLEGAL2
#endif
}
cout << endl;
{
cout << "Test raw array functions" << endl
<< "========================" << endl << endl;
cout << "SimpleRigidArray<int, 4> A;" << endl;
cout << "SimpleRigidArray<int, 4> B;" << endl;
cout << "SimpleRigidArray<float, 4> C;" << endl;
CODE( A[0]=2; A[1]=3; A[2]=4; A[3]=5; )
CODE( B[0]=1; B[1]=3; B[2]=5; B[3]=7; )
CODE( C[0]=.1; C[1]=.3; C[2]=.5; C[3]=.7; )
{
}
{
cout << "anysmaller A<B: "
cout << " anylarger A>B: "
cout << endl;
cout << "anysmaller A<B: "
cout << " anylarger A>B: "
cout << endl;
cout << "anysmaller A<B: "
cout << " anylarger A>B: "
cout << endl;
cout << "anysmaller A<B: "
cout << " anylarger A>B: "
cout << endl;
}
}
}