Skip to content

Conversation

@F-TD5X
Copy link
Contributor

@F-TD5X F-TD5X commented Jun 5, 2018

Complete basic functions
based on local Rb_tree branch, I will submit a pr later.
complete and tested function list:

insert()
lower_bound()
upper_bound()
find()
size()
max_size()
swap()
equal_range()
erase()
clear()
empty()
and construct/copy function

F-TD5X added 8 commits May 17, 2018 13:14
insert_unique(iterator __first, iterator __last)
add copy construct test
add copy construct test
@F-TD5X F-TD5X requested review from TanYz04, wenpen and zhuyutian57 June 5, 2018 13:44
@F-TD5X F-TD5X self-assigned this Jun 5, 2018
@F-TD5X F-TD5X added the enhancement New feature or request label Jun 5, 2018
@F-TD5X
Copy link
Contributor Author

F-TD5X commented Jun 5, 2018

鬼知道这代码咋就过于复杂了,简化不能。。。

Copy link

@zhuyutian57 zhuyutian57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一堆std是怎么回事?懒?


namespace custl {

template <typename _Key, typename _Compare = std::less<_Key>,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std是什么鬼

typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::size_type size_type;
typedef typename _Rep_type::difference_type difference_type;
typedef typename _Rep_type::allocator_type allocator_type;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缩进跟需要跟其他文件一样

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

事实上这里的缩进本来是一个TAB,但按照 Google Code Style 就变成空格了。。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@F-TD5X 这个wiki已经说过了,仔细读下

swap(_M_key_compare, __t._M_key_compare);
std::swap(_M_header, __t._M_header);
std::swap(_M_node_count, __t._M_node_count);
std::swap(_M_key_compare, __t._M_key_compare);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std废话啊。。。又没人写 stl_utility 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants