Skip to content

Commit 257f509

Browse files
committed
Upload SGL STL source code
1 parent 5a0e09a commit 257f509

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+34548
-0
lines changed

0_SGL_STL_Source_code/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# STL
2+
STL源码剖析

0_SGL_STL_Source_code/algo.h

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
/*
2+
*
3+
* Copyright (c) 1994
4+
* Hewlett-Packard Company
5+
*
6+
* Permission to use, copy, modify, distribute and sell this software
7+
* and its documentation for any purpose is hereby granted without fee,
8+
* provided that the above copyright notice appear in all copies and
9+
* that both that copyright notice and this permission notice appear
10+
* in supporting documentation. Hewlett-Packard Company makes no
11+
* representations about the suitability of this software for any
12+
* purpose. It is provided "as is" without express or implied warranty.
13+
*
14+
*
15+
* Copyright (c) 1996,1997
16+
* Silicon Graphics Computer Systems, Inc.
17+
*
18+
* Permission to use, copy, modify, distribute and sell this software
19+
* and its documentation for any purpose is hereby granted without fee,
20+
* provided that the above copyright notice appear in all copies and
21+
* that both that copyright notice and this permission notice appear
22+
* in supporting documentation. Silicon Graphics makes no
23+
* representations about the suitability of this software for any
24+
* purpose. It is provided "as is" without express or implied warranty.
25+
*/
26+
27+
#ifndef __SGI_STL_ALGO_H
28+
#define __SGI_STL_ALGO_H
29+
30+
#include <algobase.h>
31+
#include <tempbuf.h>
32+
#include <stl_algo.h>
33+
#include <stl_numeric.h>
34+
35+
#ifdef __STL_USE_NAMESPACES
36+
37+
// Names from <stl_algo.h>
38+
using __STD::for_each;
39+
using __STD::find;
40+
using __STD::find_if;
41+
using __STD::adjacent_find;
42+
using __STD::count;
43+
using __STD::count_if;
44+
using __STD::search;
45+
using __STD::search_n;
46+
using __STD::swap_ranges;
47+
using __STD::transform;
48+
using __STD::replace;
49+
using __STD::replace_if;
50+
using __STD::replace_copy;
51+
using __STD::replace_copy_if;
52+
using __STD::generate;
53+
using __STD::generate_n;
54+
using __STD::remove;
55+
using __STD::remove_if;
56+
using __STD::remove_copy;
57+
using __STD::remove_copy_if;
58+
using __STD::unique;
59+
using __STD::unique_copy;
60+
using __STD::reverse;
61+
using __STD::reverse_copy;
62+
using __STD::rotate;
63+
using __STD::rotate_copy;
64+
using __STD::random_shuffle;
65+
using __STD::random_sample;
66+
using __STD::random_sample_n;
67+
using __STD::partition;
68+
using __STD::stable_partition;
69+
using __STD::sort;
70+
using __STD::stable_sort;
71+
using __STD::partial_sort;
72+
using __STD::partial_sort_copy;
73+
using __STD::nth_element;
74+
using __STD::lower_bound;
75+
using __STD::upper_bound;
76+
using __STD::equal_range;
77+
using __STD::binary_search;
78+
using __STD::merge;
79+
using __STD::inplace_merge;
80+
using __STD::includes;
81+
using __STD::set_union;
82+
using __STD::set_intersection;
83+
using __STD::set_difference;
84+
using __STD::set_symmetric_difference;
85+
using __STD::min_element;
86+
using __STD::max_element;
87+
using __STD::next_permutation;
88+
using __STD::prev_permutation;
89+
using __STD::find_first_of;
90+
using __STD::find_end;
91+
using __STD::is_sorted;
92+
using __STD::is_heap;
93+
94+
// Names from stl_heap.h
95+
using __STD::push_heap;
96+
using __STD::pop_heap;
97+
using __STD::make_heap;
98+
using __STD::sort_heap;
99+
100+
// Names from <stl_numeric.h>
101+
using __STD::accumulate;
102+
using __STD::inner_product;
103+
using __STD::partial_sum;
104+
using __STD::adjacent_difference;
105+
using __STD::power;
106+
using __STD::iota;
107+
108+
#endif /* __STL_USE_NAMESPACES */
109+
110+
#endif /* __SGI_STL_ALGO_H */
111+
112+
// Local Variables:
113+
// mode:C++
114+
// End:

0_SGL_STL_Source_code/algobase.h

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
*
3+
* Copyright (c) 1994
4+
* Hewlett-Packard Company
5+
*
6+
* Permission to use, copy, modify, distribute and sell this software
7+
* and its documentation for any purpose is hereby granted without fee,
8+
* provided that the above copyright notice appear in all copies and
9+
* that both that copyright notice and this permission notice appear
10+
* in supporting documentation. Hewlett-Packard Company makes no
11+
* representations about the suitability of this software for any
12+
* purpose. It is provided "as is" without express or implied warranty.
13+
*
14+
* Copyright (c) 1996,1997
15+
* Silicon Graphics Computer Systems, Inc.
16+
*
17+
* Permission to use, copy, modify, distribute and sell this software
18+
* and its documentation for any purpose is hereby granted without fee,
19+
* provided that the above copyright notice appear in all copies and
20+
* that both that copyright notice and this permission notice appear
21+
* in supporting documentation. Silicon Graphics makes no
22+
* representations about the suitability of this software for any
23+
* purpose. It is provided "as is" without express or implied warranty.
24+
*/
25+
26+
#ifndef __SGI_STL_ALGOBASE_H
27+
#define __SGI_STL_ALGOBASE_H
28+
29+
#ifndef __SGI_STL_PAIR_H
30+
#include <pair.h>
31+
#endif
32+
#ifndef __SGI_STL_ITERATOR_H
33+
#include <iterator.h>
34+
#endif
35+
#ifndef __SGI_STL_INTERNAL_ALGOBASE_H
36+
#include <stl_algobase.h>
37+
#endif
38+
#ifndef __SGI_STL_INTERNAL_UNINITIALIZED_H
39+
#include <stl_uninitialized.h>
40+
#endif
41+
42+
#ifdef __STL_USE_NAMESPACES
43+
44+
// Names from stl_algobase.h
45+
using __STD::iter_swap;
46+
using __STD::swap;
47+
using __STD::min;
48+
using __STD::max;
49+
using __STD::copy;
50+
using __STD::copy_backward;
51+
using __STD::copy_n;
52+
using __STD::fill;
53+
using __STD::fill_n;
54+
using __STD::mismatch;
55+
using __STD::equal;
56+
using __STD::lexicographical_compare;
57+
using __STD::lexicographical_compare_3way;
58+
59+
// Names from stl_uninitialized.h
60+
using __STD::uninitialized_copy;
61+
using __STD::uninitialized_copy_n;
62+
using __STD::uninitialized_fill;
63+
using __STD::uninitialized_fill_n;
64+
65+
#endif /* __STL_USE_NAMESPACES */
66+
67+
#endif /* __SGI_STL_ALGOBASE_H */
68+
69+
// Local Variables:
70+
// mode:C++
71+
// End:

0_SGL_STL_Source_code/algorithm

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
*
3+
* Copyright (c) 1994
4+
* Hewlett-Packard Company
5+
*
6+
* Permission to use, copy, modify, distribute and sell this software
7+
* and its documentation for any purpose is hereby granted without fee,
8+
* provided that the above copyright notice appear in all copies and
9+
* that both that copyright notice and this permission notice appear
10+
* in supporting documentation. Hewlett-Packard Company makes no
11+
* representations about the suitability of this software for any
12+
* purpose. It is provided "as is" without express or implied warranty.
13+
*
14+
*
15+
* Copyright (c) 1996,1997
16+
* Silicon Graphics Computer Systems, Inc.
17+
*
18+
* Permission to use, copy, modify, distribute and sell this software
19+
* and its documentation for any purpose is hereby granted without fee,
20+
* provided that the above copyright notice appear in all copies and
21+
* that both that copyright notice and this permission notice appear
22+
* in supporting documentation. Silicon Graphics makes no
23+
* representations about the suitability of this software for any
24+
* purpose. It is provided "as is" without express or implied warranty.
25+
*/
26+
27+
#ifndef __SGI_STL_ALGORITHM
28+
#define __SGI_STL_ALGORITHM
29+
30+
#include <stl_algobase.h>
31+
#include <stl_construct.h>
32+
#include <stl_uninitialized.h>
33+
#include <stl_tempbuf.h>
34+
#include <stl_algo.h>
35+
36+
#endif /* __SGI_STL_ALGORITHM */
37+
38+
// Local Variables:
39+
// mode:C++
40+
// End:

0_SGL_STL_Source_code/alloc.h

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright (c) 1996-1997
3+
* Silicon Graphics Computer Systems, Inc.
4+
*
5+
* Permission to use, copy, modify, distribute and sell this software
6+
* and its documentation for any purpose is hereby granted without fee,
7+
* provided that the above copyright notice appear in all copies and
8+
* that both that copyright notice and this permission notice appear
9+
* in supporting documentation. Silicon Graphics makes no
10+
* representations about the suitability of this software for any
11+
* purpose. It is provided "as is" without express or implied warranty.
12+
*/
13+
14+
#ifndef __SGI_STL_ALLOC_H
15+
#define __SGI_STL_ALLOC_H
16+
17+
#ifndef __STL_CONFIG_H
18+
#include <stl_config.h>
19+
#endif
20+
#ifndef __SGI_STL_INTERNAL_ALLOC_H
21+
#include <stl_alloc.h>
22+
#endif
23+
24+
#ifdef __STL_USE_NAMESPACES
25+
26+
using __STD::__malloc_alloc_template;
27+
using __STD::malloc_alloc;
28+
using __STD::simple_alloc;
29+
using __STD::debug_alloc;
30+
using __STD::__default_alloc_template;
31+
using __STD::alloc;
32+
using __STD::single_client_alloc;
33+
#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
34+
using __STD::__malloc_alloc_oom_handler;
35+
#endif /* __STL_STATIC_TEMPLATE_MEMBER_BUG */
36+
#ifdef __STL_USE_STD_ALLOCATORS
37+
using __STD::allocator;
38+
#endif /* __STL_USE_STD_ALLOCATORS */
39+
40+
#endif /* __STL_USE_NAMESPACES */
41+
42+
#endif /* __SGI_STL_ALLOC_H */
43+
44+
// Local Variables:
45+
// mode:C++
46+
// End:

0 commit comments

Comments
 (0)