//! @copyright *this file is freware. //! @warning Use it at your own risk. //! @file functional_modulus_test.cpp //! @author Dejan D. M. Milosavljevic //! @version 1.0 //! @date 2003 //! @please "Do not remove or change this comments" //! @description functional modulus tests. //! @bug //! @warning Use it at your own risk. //! @copyright *this file is freware. #include #include #include #include #include #include "functional_modulus.hpp" using namespace std; template void print(N_iter P_begin, N_iter P_end ) { for( N_iter I_iter=P_begin; I_iter != P_end; I_iter++) cout<< setw(2) << *I_iter << " "; cout << endl; } int main_modulus( int argc, char *argv[] ) { cout << "--- main_modulus ---" << endl; vector I_left(20); list I_right(20,11); vector I_result(20); for( vector::iterator I_iter = I_left.begin(); I_iter != I_left.end(); I_iter++ ) *I_iter = rand()%30; cout << "left " ; print( I_left.begin(), I_left.end() ); cout << "right " ; print( I_right.begin(), I_right.end() ); transform( I_left.begin(), I_left.end(), I_right.begin(), I_result.begin(), modulus() ); cout << "result "; print( I_result.begin(), I_result.end() ); return 0; }