#include <xtd/xtd>
class program {
public:
static auto main() -> void {
auto boxes = box_collection {{10, 20, 30}, {20, 5, 10}, {12, 3, 7}};
for (auto iterator = boxes.begin(); iterator != boxes.end(); ++iterator)
}
struct box : public iequatable<program::box> {
box() = default;
string to_string() const noexcept {
return string::format(
"box [length={}, width={}, height={}]", length, width, height);}
};
class box_collection :
public ienumerable<program::box> {
public:
box_collection(const std::initializer_list<program::box>& boxes) : boxes_(boxes) {}
enumerator<program::box> get_enumerator() const override {
return enumerator<>::create(boxes_);
}
private:
list<program::box> boxes_;
};
};
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
generic::ienumerable< xtd::any_object > ienumerable
Exposes an enumerator, which supports a simple iteration over a non-generic collection.
Definition ienumerable.hpp:32
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:167
@ h
The H key.
Definition console_key.hpp:102
@ l
The L key.
Definition console_key.hpp:110
@ o
The O key.
Definition console_key.hpp:116
@ w
The W key.
Definition console_key.hpp:132
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
string to_string() const noexcept override
Returns the string representation of this xtd::read_only_span <type_t> object.
Definition read_only_span.hpp:375
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
Definition read_only_span.hpp:272
constexpr size_type length() const noexcept
Returns the length of the current read_only_span.
Definition read_only_span.hpp:229
Represents a boxed object.
Definition box.hpp:57
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
Definition box.hpp:148
Supports a simple iteration over a generic collection.
Definition enumerator.hpp:38
const type_t & current() const override
Gets the element in the collection at the current position of the enumerator.
Definition enumerator.hpp:62
bool move_next() override
Advances the enumerator to the next element of the collection.
Definition enumerator.hpp:71