Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
TinySTL
提交
4c322450
T
TinySTL
项目概览
OpenDocCN
/
TinySTL
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TinySTL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4c322450
编写于
1月 24, 2015
作者:
邹
邹晓航
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加容器迭代器的类型萃取
上级
db81d84b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
8 deletion
+41
-8
TinySTL/AVLTree.h
TinySTL/AVLTree.h
+4
-2
TinySTL/BinarySearchTree.h
TinySTL/BinarySearchTree.h
+4
-2
TinySTL/List.h
TinySTL/List.h
+1
-1
TinySTL/TinySTL.vcxproj
TinySTL/TinySTL.vcxproj
+9
-2
TinySTL/TinySTL.vcxproj.filters
TinySTL/TinySTL.vcxproj.filters
+21
-0
TinySTL/Unordered_set.h
TinySTL/Unordered_set.h
+2
-1
未找到文件。
TinySTL/AVLTree.h
浏览文件 @
4c322450
...
...
@@ -2,6 +2,7 @@
#define _AVL_TREE_H_
#include "Allocator.h"
#include "Iterator.h"
#include "Stack.h"
#include "String.h"
...
...
@@ -83,12 +84,13 @@ namespace TinySTL{
namespace
Detail
{
//class of avl tree iterator
template
<
class
T
>
//T = node
class
avl_iter
{
class
avl_iter
:
public
iterator
<
forward_iterator_tag
,
typename
avl_tree
<
typename
T
::
value_type
>::
value_type
>
{
private:
template
<
class
T
>
friend
class
avl_tree
;
private:
typedef
typename
avl_tree
<
typename
T
::
value_type
>::
value_type
value_type
;
//
typedef typename avl_tree<typename T::value_type>::value_type value_type;
typedef
typename
avl_tree
<
typename
T
::
value_type
>::
const_reference
const_reference
;
typedef
typename
const
T
::
value_type
*
const_pointer
;
typedef
const
avl_tree
<
typename
T
::
value_type
>
*
cntrPtr
;
...
...
TinySTL/BinarySearchTree.h
浏览文件 @
4c322450
...
...
@@ -2,6 +2,7 @@
#define _BINARY_SEARCH_TREE_H_
#include "Allocator.h"
#include "Iterator.h"
#include "Queue.h"
#include "Stack.h"
#include "String.h"
...
...
@@ -80,12 +81,13 @@ namespace TinySTL{
namespace
Detail
{
//class of bst iterator
template
<
class
T
>
//T = node
class
bst_iter
{
class
bst_iter
:
public
iterator
<
forward_iterator_tag
,
typename
::
TinySTL
::
binary_search_tree
<
typename
T
::
value_type
>::
value_type
>
{
private:
template
<
class
T
>
friend
class
::
TinySTL
::
binary_search_tree
;
private:
typedef
typename
::
TinySTL
::
binary_search_tree
<
typename
T
::
value_type
>::
value_type
value_type
;
//
typedef typename ::TinySTL::binary_search_tree<typename T::value_type>::value_type value_type;
typedef
typename
::
TinySTL
::
binary_search_tree
<
typename
T
::
value_type
>::
const_reference
const_reference
;
typedef
typename
const
T
::
value_type
*
const_pointer
;
typedef
const
::
TinySTL
::
binary_search_tree
<
typename
T
::
value_type
>
*
cntrPtr
;
...
...
TinySTL/List.h
浏览文件 @
4c322450
...
...
@@ -27,7 +27,7 @@ namespace TinySTL{
};
//the class of list iterator
template
<
class
T
>
struct
listIterator
:
public
bidirectional_iterator
<
T
,
ptrdiff_t
>
{
struct
listIterator
:
public
iterator
<
bidirectional_iterator_tag
,
T
>
{
template
<
class
T
>
friend
class
list
;
public:
...
...
TinySTL/TinySTL.vcxproj
浏览文件 @
4c322450
...
...
@@ -54,7 +54,7 @@
</PrecompiledHeader>
<WarningLevel>
Level3
</WarningLevel>
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<PreprocessorDefinitions>
WIN32;_DEBUG;_CONSOLE;_LIB;
NOMINMAX;
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>
Console
</SubSystem>
...
...
@@ -69,7 +69,7 @@
<Optimization>
MaxSpeed
</Optimization>
<FunctionLevelLinking>
true
</FunctionLevelLinking>
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<PreprocessorDefinitions>
WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<PreprocessorDefinitions>
WIN32;NDEBUG;_CONSOLE;_LIB;
NOMINMAX;
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>
Console
</SubSystem>
...
...
@@ -84,6 +84,7 @@
<ClCompile
Include=
"main.cpp"
/>
<ClCompile
Include=
"Profiler\Profiler.cpp"
/>
<ClCompile
Include=
"Test\AlgorithmTest.cpp"
/>
<ClCompile
Include=
"Test\AVLTreeTest.cpp"
/>
<ClCompile
Include=
"Test\BinarySearchTreeTest.cpp"
/>
<ClCompile
Include=
"Test\BitmapTest.cpp"
/>
<ClCompile
Include=
"Test\CircularBufferTest.cpp"
/>
...
...
@@ -95,6 +96,7 @@
<ClCompile
Include=
"Test\StackTest.cpp"
/>
<ClCompile
Include=
"Test\StringTest.cpp"
/>
<ClCompile
Include=
"Test\SuffixArrayTest.cpp"
/>
<ClCompile
Include=
"Test\Unordered_setTest.cpp"
/>
<ClCompile
Include=
"Test\VectorTest.cpp"
/>
</ItemGroup>
<ItemGroup>
...
...
@@ -107,11 +109,13 @@
<ClInclude
Include=
"CircularBuffer.h"
/>
<ClInclude
Include=
"Construct.h"
/>
<ClInclude
Include=
"Deque.h"
/>
<ClInclude
Include=
"Detail\AVLTree.impl.h"
/>
<ClInclude
Include=
"Detail\BinarySearchTree.impl.h"
/>
<ClInclude
Include=
"Detail\Bitmap.impl.h"
/>
<ClInclude
Include=
"Detail\CircularBuffer.impl.h"
/>
<ClInclude
Include=
"Detail\Deque.impl.h"
/>
<ClInclude
Include=
"Detail\List.impl.h"
/>
<ClInclude
Include=
"Detail\Unordered_set.impl.h"
/>
<ClInclude
Include=
"Detail\Vector.impl.h"
/>
<ClInclude
Include=
"Functional.h"
/>
<ClInclude
Include=
"Iterator.h"
/>
...
...
@@ -123,6 +127,7 @@
<ClInclude
Include=
"String.h"
/>
<ClInclude
Include=
"SuffixArray.h"
/>
<ClInclude
Include=
"Test\AlgorithmTest.h"
/>
<ClInclude
Include=
"Test\AVLTreeTest.h"
/>
<ClInclude
Include=
"Test\BinarySearchTreeTest.h"
/>
<ClInclude
Include=
"Test\BitmapTest.h"
/>
<ClInclude
Include=
"Test\CircularBufferTest.h"
/>
...
...
@@ -135,9 +140,11 @@
<ClInclude
Include=
"Test\StringTest.h"
/>
<ClInclude
Include=
"Test\SuffixArrayTest.h"
/>
<ClInclude
Include=
"Test\TestUtil.h"
/>
<ClInclude
Include=
"Test\Unordered_setTest.h"
/>
<ClInclude
Include=
"Test\VectorTest.h"
/>
<ClInclude
Include=
"TypeTraits.h"
/>
<ClInclude
Include=
"UninitializedFunctions.h"
/>
<ClInclude
Include=
"Unordered_set.h"
/>
<ClInclude
Include=
"Utility.h"
/>
<ClInclude
Include=
"Vector.h"
/>
</ItemGroup>
...
...
TinySTL/TinySTL.vcxproj.filters
浏览文件 @
4c322450
...
...
@@ -78,6 +78,12 @@
<ClCompile
Include=
"Test\BinarySearchTreeTest.cpp"
>
<Filter>
Test
</Filter>
</ClCompile>
<ClCompile
Include=
"Test\AVLTreeTest.cpp"
>
<Filter>
Test
</Filter>
</ClCompile>
<ClCompile
Include=
"Test\Unordered_setTest.cpp"
>
<Filter>
Test
</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"TypeTraits.h"
>
...
...
@@ -206,6 +212,21 @@
<ClInclude
Include=
"Detail\BinarySearchTree.impl.h"
>
<Filter>
Detail
</Filter>
</ClInclude>
<ClInclude
Include=
"Test\AVLTreeTest.h"
>
<Filter>
Test
</Filter>
</ClInclude>
<ClInclude
Include=
"Detail\AVLTree.impl.h"
>
<Filter>
Detail
</Filter>
</ClInclude>
<ClInclude
Include=
"Unordered_set.h"
>
<Filter>
头文件
</Filter>
</ClInclude>
<ClInclude
Include=
"Detail\Unordered_set.impl.h"
>
<Filter>
Detail
</Filter>
</ClInclude>
<ClInclude
Include=
"Test\Unordered_setTest.h"
>
<Filter>
Test
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None
Include=
"..\README.md"
/>
...
...
TinySTL/Unordered_set.h
浏览文件 @
4c322450
...
...
@@ -4,6 +4,7 @@
#include "Allocator.h"
#include "Algorithm.h"
#include "Functional.h"
#include "Iterator.h"
#include "List.h"
#include "Vector.h"
...
...
@@ -13,7 +14,7 @@ namespace TinySTL{
namespace
Detail
{
template
<
class
Key
,
class
ListIterator
,
class
Hash
=
std
::
hash
<
Key
>,
class
KeyEqual
=
TinySTL
::
equal_to
<
Key
>
,
class
Allocator
=
TinySTL
::
allocator
<
Key
>>
class
ust_iterator
{
class
ust_iterator
:
public
iterator
<
forward_iterator_tag
,
Key
>
{
private:
template
<
class
Key
,
class
Hash
,
class
KeyEqual
,
class
Allocator
>
friend
class
Unordered_set
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录