From 62b5afc0bdff7fe33a347ab53a83e02d9f04f97e Mon Sep 17 00:00:00 2001 From: Oskar Date: Tue, 8 Oct 2024 21:15:10 +0200 Subject: more --- 9p10.cpp | 21 +++++++++++++++++++++ 9p7.cpp | 16 ++++++++++++++++ 9p8.cpp | 16 ++++++++++++++++ 9p9.cpp | 14 ++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 9p10.cpp create mode 100644 9p7.cpp create mode 100644 9p8.cpp create mode 100644 9p9.cpp diff --git a/9p10.cpp b/9p10.cpp new file mode 100644 index 0000000..566b96e --- /dev/null +++ b/9p10.cpp @@ -0,0 +1,21 @@ +#include +#include + +/* + * + * 9.10 + * + * + */ + +int main () { + + std::vector v1; + const std::vector v2; + std::vector::iterator it1 = v1.begin(); // std::vector::iterator + std::vector::const_iterator it2 = v2.begin(); // std::vector::const_iterator + std::vector::const_iterator it3 = v1.cbegin(); // std::vector::const_iterator + std::vector::const_iterator it4 = v2.cbegin(); // std::vector::const_iterator + if(*it1 || *it2 || *it3 || *it4) + return 0; +} diff --git a/9p7.cpp b/9p7.cpp new file mode 100644 index 0000000..ec19880 --- /dev/null +++ b/9p7.cpp @@ -0,0 +1,16 @@ +#include +#include + +/* + * + * 9.7 + * + * + */ + +int main () { + std::vector a(10,10); + auto i = a.size(); // It's a std::vector::size_type + if(i) + return 0; +} diff --git a/9p8.cpp b/9p8.cpp new file mode 100644 index 0000000..32b0290 --- /dev/null +++ b/9p8.cpp @@ -0,0 +1,16 @@ +#include +#include + +/* + * + * 9.8 + * + * + */ + +int main () { + + std::list::const_iterator cbeg; // to read + std::list::iterator beg; // to write + return 0; +} diff --git a/9p9.cpp b/9p9.cpp new file mode 100644 index 0000000..89ef7e1 --- /dev/null +++ b/9p9.cpp @@ -0,0 +1,14 @@ + +/* + * + * 9.9 + * + * + */ + +int main () { + + // begin returns an iterator. Can be both written and read from. + // cbegin returns a const iterator. Can only be read from. + return 0; +} -- cgit v1.2.3