Mercurial > thymian
comparison 3rdparty/vmime/cmake/cmake-cxx11/Modules/CheckCXX11Features/cxx11-test-initializer_list.cpp @ 0:a4671277546c tip
created the repository for the thymian project
| author | ferencd |
|---|---|
| date | Tue, 17 Aug 2021 11:19:54 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:a4671277546c |
|---|---|
| 1 #include <vector> | |
| 2 | |
| 3 class seq { | |
| 4 public: | |
| 5 seq(std::initializer_list<int> list); | |
| 6 | |
| 7 int length() const; | |
| 8 private: | |
| 9 std::vector<int> m_v; | |
| 10 }; | |
| 11 | |
| 12 seq::seq(std::initializer_list<int> list) | |
| 13 : m_v(list) | |
| 14 { | |
| 15 } | |
| 16 | |
| 17 int seq::length() const | |
| 18 { | |
| 19 return m_v.size(); | |
| 20 } | |
| 21 | |
| 22 int main(void) | |
| 23 { | |
| 24 seq a = {18, 20, 2, 0, 4, 7}; | |
| 25 | |
| 26 return (a.length() == 6) ? 0 : 1; | |
| 27 } |
