-
Notifications
You must be signed in to change notification settings - Fork 0
/
snippets.cpp
42 lines (24 loc) · 1.5 KB
/
snippets.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const auto container = std::vector<int>{1, 3, 224, 224};
const auto beg = std::begin(container);
const auto end = std::end(container);
for (auto it = beg; it != end; ++it) { std::cout << *it << std::endl; }
for (const auto& elem : container) { std::cout << elem << std::endl; }
std::for_each(beg, end, [](const auto& elem) { std::cout << elem << std::endl; });
const auto sorted = std::is_sorted(beg, end);
/**************************************************************************************************/
const auto container = std::array<int, 4>{1, 3, 224, 224};
const auto beg = std::begin(container);
const auto end = std::end(container);
for (auto it = beg; it != end; ++it) { std::cout << *it << std::endl; }
for (const auto& elem : container) { std::cout << elem << std::endl; }
std::for_each(beg, end, [](const auto& elem) { std::cout << elem << std::endl; });
const auto sorted = std::is_sorted(beg, end);
/**************************************************************************************************/
const auto container = std::set<int>{1, 3, 224, 224};
const auto beg = std::begin(container);
const auto end = std::end(container);
for (auto it = beg; it != end; ++it) { std::cout << *it << std::endl; }
for (const auto& elem : container) { std::cout << elem << std::endl; }
std::for_each(beg, end, [](const auto& elem) { std::cout << elem << std::endl; });
const auto sorted = std::is_sorted(beg, end);
/**************************************************************************************************/