From 3bc466de15e4bb9e13ccbe4f3e87cd46fd923f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Sun, 12 Oct 2014 14:43:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0queue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TinySTL/Queue.h | 17 +++++++++++++++++ TinySTL/TinySTL.vcxproj | 4 ++++ TinySTL/TinySTL.vcxproj.filters | 12 ++++++++++++ TinySTL/main.cpp | 24 +++++++++++++++--------- 4 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 TinySTL/Queue.h diff --git a/TinySTL/Queue.h b/TinySTL/Queue.h new file mode 100644 index 0000000..c9d7388 --- /dev/null +++ b/TinySTL/Queue.h @@ -0,0 +1,17 @@ +#ifndef _QUEUE_H_ +#define _QUEUE_H_ + +#include "Deque.h" +#include "Vector.h" + +namespace TinySTL{ + //class of queue + template> + class queue{}; + //class of priority_queue + template , + class Compare = TinySTL::less> + class priority_queue{}; +} + +#endif \ No newline at end of file diff --git a/TinySTL/TinySTL.vcxproj b/TinySTL/TinySTL.vcxproj index 770fdc2..eb56b30 100644 --- a/TinySTL/TinySTL.vcxproj +++ b/TinySTL/TinySTL.vcxproj @@ -89,9 +89,13 @@ + + + + diff --git a/TinySTL/TinySTL.vcxproj.filters b/TinySTL/TinySTL.vcxproj.filters index 7dc41d5..e5fb7a4 100644 --- a/TinySTL/TinySTL.vcxproj.filters +++ b/TinySTL/TinySTL.vcxproj.filters @@ -65,5 +65,17 @@ 头文件 + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + \ No newline at end of file diff --git a/TinySTL/main.cpp b/TinySTL/main.cpp index 02732b9..ace2624 100644 --- a/TinySTL/main.cpp +++ b/TinySTL/main.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -11,20 +12,25 @@ #include -#include "Bitmap.h" +#include "Algorithm.h" +#include "String.h" +#include "Vector.h" #include "Profiler\Profiler.h" -using namespace std; using namespace TinySTL::Profiler; int main(){ - std::string str("abcdefghijklmnpqrstuvwxyz"); - TinySTL::bitmap<26> bm; - for (auto it = str.cbegin(); it != str.cend(); ++it){ - bm.set(*it - 'a'); - } - cout << bm << endl; - cout << bm.size() << endl; + /*char array[] = "+C"; + TinySTL::string s("LoveC++"); + TinySTL::string str("ZXHLoveC++VeryMuch"); + cout << str.find_first_of(array, 0, str.size()) << endl;*/ + TinySTL::string name("zxh"); + //std::string name("zxh"); + + std::cout << "Please, enter your full name: "; + TinySTL::getline(std::cin, name,'i'); + //std::getline(std::cin, name); + std::cout << name << "\n"; system("pause"); return 0; }