This commit is contained in:
邹晓航
2014-11-07 14:49:57 +08:00
parent 4ae4878d3e
commit 39fc2e899e

View File

@@ -1,49 +1,59 @@
#include <algorithm> //#include <algorithm>
#include <atomic> //#include <atomic>
#include <cassert> //#include <cassert>
#include <cctype> //#include <cctype>
#include <condition_variable> //#include <condition_variable>
#include <iostream> //#include <iostream>
#include <list> //#include <list>
#include <new> //#include <new>
#include <mutex> //#include <mutex>
#include <memory> //#include <memory>
#include <string> //#include <string>
#include <vector> //#include <vector>
#include <iterator> //#include <iterator>
#include <queue> //#include <queue>
#include <random> //#include <random>
#include <thread> //#include <thread>
#include <utility> //#include <utility>
//
#include <boost\circular_buffer.hpp> //#include <boost\circular_buffer.hpp>
//
#include "Algorithm.h" //#include "Algorithm.h"
#include "String.h" //#include "String.h"
#include "Vector.h" //#include "Vector.h"
#include "Profiler\Profiler.h" //#include "Profiler\Profiler.h"
//
#include "BinarySearchTree.h" //#include "AVLTree.h"
#include "CircularBuffer.h" //#include "BinarySearchTree.h"
#include "Deque.h" //#include "CircularBuffer.h"
#include "Queue.h" //#include "Deque.h"
#include "Stack.h" //#include "Queue.h"
//#include "Stack.h"
using namespace std; //
using namespace TinySTL::Profiler; //using namespace std;
bool comp_case_insensitive(char c1, char c2) { //using namespace TinySTL::Profiler;
return (std::tolower(c1) == std::tolower(c2)); //bool mypredicate(int i, int j) {
} // return (i == j);
int main(){ //}
TinySTL::deque<int> dq; ////int main(){
for (int i = 0; i != 10; ++i) //// TinySTL::vector<int> myvector;
dq.push_front(i); //// for (int i = 1; i<6; i++) myvector.push_back(i * 10); // myvector: 10 20 30 40 50
/*for (auto x : dq) ////
cout << x << endl;*/ //// int myints[] = { 10, 20, 80, 320, 1024 }; // myints: 10 20 80 320 1024
for (auto rit = dq.begin(); rit != dq.end(); ++rit) ////
cout << *rit << endl; //// std::pair<TinySTL::vector<int>::iterator, int*> mypair;
for (auto x : dq) ////
cout << x << endl; //// // using default comparison:
system("pause"); //// mypair = TinySTL::mismatch(myvector.begin(), myvector.end(), myints);
return 0; //// 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;
////}