Skip to content

Commit 6e296d0

Browse files
authored
Merge pull request #1256 from trcrsired/next
remove end_ptr in the iterator itself, only keep it in container
2 parents 470c8ae + 0661f8b commit 6e296d0

4 files changed

Lines changed: 673 additions & 160 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include <fast_io.h>
2+
#include <fast_io_driver/timer.h>
3+
#include <fast_io_dsal/deque.h>
4+
5+
int main()
6+
{
7+
fast_io::timer tm(u8"fast_io::deque");
8+
fast_io::deque<std::size_t> deq;
9+
constexpr std::size_t n{100000000};
10+
{
11+
fast_io::timer tm1(u8"push_front");
12+
for (std::size_t i{}; i != n; ++i)
13+
{
14+
deq.push_front(i);
15+
}
16+
}
17+
::std::size_t sum{};
18+
{
19+
fast_io::timer tm1(u8"loop");
20+
for (auto const e : deq)
21+
{
22+
sum += e;
23+
}
24+
}
25+
::fast_io::io::perrln("sum=",sum);
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include <fast_io.h>
2+
#include <fast_io_driver/timer.h>
3+
#include <deque>
4+
5+
int main()
6+
{
7+
fast_io::timer tm(u8"std::deque");
8+
std::deque<std::size_t> deq;
9+
constexpr std::size_t n{100000000};
10+
{
11+
fast_io::timer tm1(u8"push_front");
12+
for (std::size_t i{}; i != n; ++i)
13+
{
14+
deq.push_front(i);
15+
}
16+
}
17+
::std::size_t sum{};
18+
{
19+
fast_io::timer tm1(u8"loop");
20+
for (auto const e : deq)
21+
{
22+
sum += e;
23+
}
24+
}
25+
::fast_io::io::perrln("sum=",sum);
26+
}

0 commit comments

Comments
 (0)