From 39fc2e899ef770b092b4ccddec92cbe4552e1194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Fri, 7 Nov 2014 14:49:57 +0800 Subject: [PATCH] test --- TinySTL/main.cpp | 108 ++++++++++++++++++++++++++--------------------- 1 file changed, 59 insertions(+), 49 deletions(-) diff --git a/TinySTL/main.cpp b/TinySTL/main.cpp index 9fd79e8..2b3821d 100644 --- a/TinySTL/main.cpp +++ b/TinySTL/main.cpp @@ -1,49 +1,59 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "Algorithm.h" -#include "String.h" -#include "Vector.h" -#include "Profiler\Profiler.h" - -#include "BinarySearchTree.h" -#include "CircularBuffer.h" -#include "Deque.h" -#include "Queue.h" -#include "Stack.h" - -using namespace std; -using namespace TinySTL::Profiler; -bool comp_case_insensitive(char c1, char c2) { - return (std::tolower(c1) == std::tolower(c2)); -} -int main(){ - TinySTL::deque dq; - for (int i = 0; i != 10; ++i) - dq.push_front(i); - /*for (auto x : dq) - cout << x << endl;*/ - for (auto rit = dq.begin(); rit != dq.end(); ++rit) - cout << *rit << endl; - for (auto x : dq) - cout << x << endl; - system("pause"); - return 0; -} +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +// +//#include +// +//#include "Algorithm.h" +//#include "String.h" +//#include "Vector.h" +//#include "Profiler\Profiler.h" +// +//#include "AVLTree.h" +//#include "BinarySearchTree.h" +//#include "CircularBuffer.h" +//#include "Deque.h" +//#include "Queue.h" +//#include "Stack.h" +// +//using namespace std; +//using namespace TinySTL::Profiler; +//bool mypredicate(int i, int j) { +// return (i == j); +//} +////int main(){ +//// TinySTL::vector myvector; +//// for (int i = 1; i<6; i++) myvector.push_back(i * 10); // myvector: 10 20 30 40 50 +//// +//// int myints[] = { 10, 20, 80, 320, 1024 }; // myints: 10 20 80 320 1024 +//// +//// std::pair::iterator, int*> mypair; +//// +//// // using default comparison: +//// mypair = TinySTL::mismatch(myvector.begin(), myvector.end(), myints); +//// std::cout << "First mismatching elements: " << *mypair.first; +//// std::cout << " and " << *mypair.second << '\n'; +//// +//// ++mypair.first; ++mypair.second; +//// +//// // using predicate comparison: +//// mypair = TinySTL::mismatch(mypair.first, myvector.end(), mypair.second, mypredicate); +//// std::cout << "Second mismatching elements: " << *mypair.first; +//// std::cout << " and " << *mypair.second << '\n'; +//// system("pause"); +//// return 0; +////}