添加queue
This commit is contained in:
17
TinySTL/Queue.h
Normal file
17
TinySTL/Queue.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#ifndef _QUEUE_H_
|
||||||
|
#define _QUEUE_H_
|
||||||
|
|
||||||
|
#include "Deque.h"
|
||||||
|
#include "Vector.h"
|
||||||
|
|
||||||
|
namespace TinySTL{
|
||||||
|
//class of queue
|
||||||
|
template<class T, class Containter = TinySTL::deque<T>>
|
||||||
|
class queue{};
|
||||||
|
//class of priority_queue
|
||||||
|
template <class T, class Container = TinySTL::vector<T>,
|
||||||
|
class Compare = TinySTL::less<typename Container::value_type>>
|
||||||
|
class priority_queue{};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -89,9 +89,13 @@
|
|||||||
<ClInclude Include="Bitmap.h" />
|
<ClInclude Include="Bitmap.h" />
|
||||||
<ClInclude Include="CircularBuffer.h" />
|
<ClInclude Include="CircularBuffer.h" />
|
||||||
<ClInclude Include="Construct.h" />
|
<ClInclude Include="Construct.h" />
|
||||||
|
<ClInclude Include="Deque.h" />
|
||||||
|
<ClInclude Include="Functional.h" />
|
||||||
<ClInclude Include="Iterator.h" />
|
<ClInclude Include="Iterator.h" />
|
||||||
<ClInclude Include="Profiler\Profiler.h" />
|
<ClInclude Include="Profiler\Profiler.h" />
|
||||||
|
<ClInclude Include="Queue.h" />
|
||||||
<ClInclude Include="ReverseIterator.h" />
|
<ClInclude Include="ReverseIterator.h" />
|
||||||
|
<ClInclude Include="Stack.h" />
|
||||||
<ClInclude Include="String.h" />
|
<ClInclude Include="String.h" />
|
||||||
<ClInclude Include="TypeTraits.h" />
|
<ClInclude Include="TypeTraits.h" />
|
||||||
<ClInclude Include="UninitializedFunctions.h" />
|
<ClInclude Include="UninitializedFunctions.h" />
|
||||||
|
|||||||
@@ -65,5 +65,17 @@
|
|||||||
<ClInclude Include="Bitmap.h">
|
<ClInclude Include="Bitmap.h">
|
||||||
<Filter>头文件</Filter>
|
<Filter>头文件</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="Stack.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Deque.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Queue.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Functional.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -11,20 +12,25 @@
|
|||||||
|
|
||||||
#include <boost\circular_buffer.hpp>
|
#include <boost\circular_buffer.hpp>
|
||||||
|
|
||||||
#include "Bitmap.h"
|
#include "Algorithm.h"
|
||||||
|
#include "String.h"
|
||||||
|
#include "Vector.h"
|
||||||
#include "Profiler\Profiler.h"
|
#include "Profiler\Profiler.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace TinySTL::Profiler;
|
using namespace TinySTL::Profiler;
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
std::string str("abcdefghijklmnpqrstuvwxyz");
|
/*char array[] = "+C";
|
||||||
TinySTL::bitmap<26> bm;
|
TinySTL::string s("LoveC++");
|
||||||
for (auto it = str.cbegin(); it != str.cend(); ++it){
|
TinySTL::string str("ZXHLoveC++VeryMuch");
|
||||||
bm.set(*it - 'a');
|
cout << str.find_first_of(array, 0, str.size()) << endl;*/
|
||||||
}
|
TinySTL::string name("zxh");
|
||||||
cout << bm << endl;
|
//std::string name("zxh");
|
||||||
cout << bm.size() << endl;
|
|
||||||
|
std::cout << "Please, enter your full name: ";
|
||||||
|
TinySTL::getline(std::cin, name,'i');
|
||||||
|
//std::getline(std::cin, name);
|
||||||
|
std::cout << name << "\n";
|
||||||
system("pause");
|
system("pause");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user