Documentation


vector_test.cpp

#include <iostream>
#include <animal/vector.h>
#include <animal/io.h>

using std::cout;
using std::cin;
using std::endl;
using std::flush;

const int size = 5;
typedef animal::vector< double > Vector;

// ===============================================
// Main program.

int main()
{
  
    
  cout<<"\n============================================================\n";
  cout<<"Test program for class vector"<<endl;
  cout<<"============================================================\n"<<endl;
  
    Vector v( size );
    cout<<"Vector initialized by default: "<< animal::v_output(v) <<endl;
    
    cout<< endl <<"# Test range checking (disabled when -DNDEBUG is specified for compiling)" << endl;
    cout<<" v[0] = " << v[0] << endl;
    cout<<" v[size-1] = "<< v[size-1] << endl;
    cout<<" v[-1] = "<< flush << v[-1] << endl;
    cout<<" v[size] = "<< flush << v[size] << endl;

  return 0;
}

Generated on Thu Dec 23 13:52:23 2004 by doxygen 1.3.6