添加less
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
#ifndef _DEQUE_H_
|
||||
#define _DEQUE_H_
|
||||
|
||||
namespace TinySTL{
|
||||
#include "Allocator.h"
|
||||
|
||||
namespace TinySTL{
|
||||
//class of deque
|
||||
template<class T, class Alloc = TinySTL::allocator<T>>
|
||||
class deque{};
|
||||
}
|
||||
#endif
|
||||
17
TinySTL/Functional.h
Normal file
17
TinySTL/Functional.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef _FUNCTIONAL_H_
|
||||
#define _FUNCTIONAL_H_
|
||||
|
||||
namespace TinySTL{
|
||||
//********** [less] ****************
|
||||
template<class T>
|
||||
struct less{
|
||||
typedef T first_argument_type;
|
||||
typedef T second_argument_type;
|
||||
typedef bool result_type;
|
||||
|
||||
result_type operator()(const first_argument_type& x, const second_argument_type& y){
|
||||
return x < y;
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
@@ -1,7 +1,11 @@
|
||||
#ifndef _STACK_H_
|
||||
#define _STACK_H_
|
||||
|
||||
namespace TinySTL{
|
||||
#include "Deque.h"
|
||||
|
||||
namespace TinySTL{
|
||||
//class of stack
|
||||
template<class T, class Container = TinySTL::deque<T>>
|
||||
class stack{};
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user