From 6c852938535494a5e7e1a4f71d0054cdef9ea6e6 Mon Sep 17 00:00:00 2001 From: Yohan Boujon Date: Wed, 4 Oct 2023 08:40:19 +0200 Subject: [PATCH] TD4 fini. --- td/td4/src/main.cpp | 42 ++++-------------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/td/td4/src/main.cpp b/td/td4/src/main.cpp index d6db6b9..ee73c0e 100644 --- a/td/td4/src/main.cpp +++ b/td/td4/src/main.cpp @@ -7,44 +7,10 @@ int main(void) { - Smart_Vector smartInt, test(10,6); - for(int i=0; i<6; i++) - smartInt.PushBack(i); + Vector floatVector(3,1.5); + Vector stringVector(5, "Super chaine"); + Vector charVector(3, 'a'); - std::cout << smartInt << std::endl; - std::cout << test << std::endl; - - std::cout << smartInt + test << std::endl; - std::cout << smartInt + smartInt << std::endl; - - Smart_Vector little(5,1), big(10,5); - little += big; - std::cout << little << std::endl; - little = Smart_Vector(5,1); - big += little; - std::cout << big << std::endl; - - // Deque test - Deque dequeInt; - for(int i=0; i<6; i++) - dequeInt.PushBack(i); - std::cout << "Deque push back: " << dequeInt << std::endl; - for(int i=1; i<=6; i++) - dequeInt.PushFront(i*10); - std::cout << "Deque push front: " << dequeInt << std::endl; - std::cout << "End capacity: " << dequeInt.Capacity() << std::endl; - - std::cout << "Deque Front Elements: " << dequeInt.GetFront() << std::endl; - std::cout << "Deque Back Elements: " << dequeInt.GetBack() << std::endl; - dequeInt.RemoveBack(); - std::cout << "After Removing Back: " << dequeInt << std::endl; - dequeInt.PushBack(56); - std::cout << "Pushing Back again: " << dequeInt << std::endl; - dequeInt.RemoveFront(); - std::cout << "After Removing Front: " << dequeInt << std::endl; - dequeInt.PushFront(10); - std::cout << "Front: " << dequeInt.GetFront() << "\tBack: " << dequeInt.GetBack() << "\tFull Deque: " << dequeInt << "\tWith Capacity: " << dequeInt.Capacity() << std::endl; - dequeInt.ShrinkToFit(); - std::cout << "After ShrinkToFit: " << dequeInt.Capacity() << "\tWith: " << dequeInt << std::endl; + std::cout << floatVector << "\n" << stringVector << "\n" << charVector << std::endl; return 0; } \ No newline at end of file