2 * Demonstration of a dynamically sizing Array Template including STL Iterator
3 * Copyright (c) 2014 TJ <hacker@iam.tj>
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "DynamicArrayTemplateImpl.hpp"
26 main(int argc, char **argv, char **env)
28 cout << "Dynamic Array with Iterator Demonstrator" << endl
29 << "Copyright 2014 TJ <hacker@iam.tj>" << endl
30 << "Licensed on terms of the GNU General Public License version 3.0" << endl;
31 DynamicArrayTemplateImpl< DynamicArrayTemplateImpl<int> > array_of_arrays;
32 DynamicArrayTemplateImpl<int> array_of_ints;
33 DynamicArrayTemplateImpl<int>::_const_iterator i = array_of_ints.begin();
34 DynamicArrayTemplateImpl<DynamicArrayTemplateImpl<int>>::_const_iterator j = array_of_arrays.begin();
40 cout << endl << "Menu" << endl
41 << "1. Create array" << endl
42 << "2. Add element" << endl
43 << "3. Remove element" << endl
44 << "4. List array elements using Iterator" << endl
45 << "5. List array elements using subscript operator[]" << endl
46 << "7. List array elements using pointers (element_at())" << endl
47 << "8. Delete array" << endl
56 case 1: // Create array
58 case 2: // Add element
60 case 3: // Remove element
62 case 4: // List using Iterator
64 case 5: // List using subscript operator[]
66 case 6: // List using pointer element_at()
69 } while (menu_choice > 0);
71 cout << endl << "Finished." << endl;