-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathuniform_initialization.cpp
More file actions
73 lines (60 loc) · 1.92 KB
/
uniform_initialization.cpp
File metadata and controls
73 lines (60 loc) · 1.92 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//*****************************************************************************
//
// Author: Michael Price
// License: Attribution-NonCommercial-NoDerivs 3.0 Unported
// http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode
//
//*****************************************************************************
// #ifndef WIN32
// namespace std {
// template<class _Ep>
// class initializer_list
// {
// const _Ep* __begin_;
// long long __size_;
// initializer_list(const _Ep* __b, long long __s)
// : __begin_(__b),
// __size_(__s)
// {}
// public:
// typedef _Ep value_type;
// typedef const _Ep& reference;
// typedef const _Ep& const_reference;
// typedef long long size_type;
// typedef const _Ep* iterator;
// typedef const _Ep* const_iterator;
// initializer_list() : __begin_(nullptr), __size_(0) {}
// long long size() const {return __size_;}
// const _Ep* begin() const {return __begin_;}
// const _Ep* end() const {return __begin_ + __size_;}
// };
// template <typename T>
// class vector
// {
// public:
// vector<std::initializer_list<T>> () { }
// };
// }
// #endif // WIN32
class Avenger
{
public:
Avenger () : Avenger("Newb") { }
Avenger (const char * name) { }
~Avenger () { }
Avenger (const Avenger&) { }
Avenger (Avenger &&) { }
};
Avenger getCat () { return Avenger("Black Panther"); }
void avengers_assemble ()
{
Avenger cap("Captain America");
Avenger irony = "Iron-Man";
Avenger strongest = Avenger("Hulk");
Avenger skrull(cap);
Avenger cat(getCat());
//Avenger newb(); // function declaration!!!
Avenger newb{}; // variable declaration!!!
// std::vector<Avenger> team = {cap, irony, strongest, cat, newb, "Thor"};
// instead of vector::push_back!
}