xtd 0.2.0
collection_operators.hpp
Go to the documentation of this file.
1
4#pragma once
5
7namespace xtd {
9 namespace collections {
11 namespace generic {
13 namespace extensions {
30 template<class type_t, class collection_t>
32 public:
34
39 virtual collection_t& operator <<(const type_t& item) {
40 auto& self = static_cast<collection_t&>(*this);
41 self.add(item);
42 return self;
43 }
44
50 virtual collection_t& operator >>(const type_t& item) {
51 auto& self = static_cast<collection_t&>(*this);
52 self.remove(item);
53 return self;
54 }
56
57 private:
58 friend collection_t;
59 collection_operators() = default;
60 };
61 }
62 }
63 }
64}
Internal collection operators definition.
Definition collection_operators.hpp:31
virtual collection_t & operator>>(const type_t &item)
The shift right operator removes tthe first occurrence of a specific object from the xtd::collections...
Definition collection_operators.hpp:50
virtual collection_t & operator<<(const type_t &item)
The shift left operator adds an item to the xtd::collections::generic::icollection <type_t>.
Definition collection_operators.hpp:39
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10