#include <xtd/xtd>
class example {
public:
static auto main() -> void {
console::write_line("\ncapacity: {0}", dinosaurs.capacity());
dinosaurs.add("Tyrannosaurus");
dinosaurs.add("Amargasaurus");
dinosaurs.add("Deinonychus");
dinosaurs.add("Compsognathus");
console::write_line();
for (auto dinosaur : dinosaurs)
console::write_line(dinosaur);
console::write_line("\nauto ro_dinosaurs = dinosaurs.as_read_only()");
auto ro_dinosaurs = dinosaurs.as_read_only();
console::write_line("\nElements in the read-only ilist:");
for (auto dinosaur : ro_dinosaurs)
console::write_line(dinosaur);
console::write_line("\ndinosaurs[2] = \"Coelophysis\"");
dinosaurs[2] = "Coelophysis";
console::write_line("\nElements in the read-only ilist:");
for (auto dinosaur : ro_dinosaurs)
console::write_line(dinosaur);
}
};
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:71
#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:175
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:15
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10