template<typename type_t>
class xtd::collections::generic::params< type_t >
An object of type xtd::collections::generic::params <type_t> is a lightweight proxy object that provides access to an array of objects of type const type_t
(that may be allocated in read-only memory).
template<typename type_t>
An object of type xtd::collections::generic::params <type_t> is a lightweight proxy object that provi...
Definition params.h:40
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
- Header
#include <xtd/collections/generic/params
- Namespace
- xtd::collections::generic
- Library
- xtd.core
- Warning
- When creating your own container, use the std::initializer_list object instead of the xtd::collections::generic::params object for the constructor, because C++ compilers use a magic trick (such as a private constructor) to initialize elements correctly. Use xtd::collections::generic::params when initializing elements yourself.
- Examples
- The following example demonstrates how to usea xtd::collections::generic::params <type_t> class.
#include <xtd/collections/generic/list>
#include <xtd/console>
#include <xtd/startup>
#include <xtd/time_span>
#include <vector>
class program {
public:
static auto main() -> void {
console::write_line(
"params = {}",
params {1, 2, 3, 4, 5});
console::write_line(
"vector = {}", std::vector<int> {
params {1, 2, 3, 4, 5}});
console::write_line(
"create_list = {}", create_list(
params {
"one",
"two",
"three",
"four",
"five"}));
console::write_line(
"create_vector = {}", create_vector(
params {3_h + 2_min + 1_s, 3_h + 2_min + 2_s, 3_h + 2_min + 3_s, 3_h + 2_min + 4_s, 3_h + 2_min + 5_s}));
}
private:
template <typename type_t>
}
template <typename type_t>
return std::vector<type_t> {items};
}
};
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.h:72
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.h:175
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.h:15
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
|
using | base_type = std::initializer_list< type_t > |
| Represents the params base type.
|
|
using | value_type = typename base_type::value_type |
| Represents the params value type.
|
|
using | reference = typename base_type::reference |
| Represents the reference of params value type.
|
|
using | const_reference = typename base_type::const_reference |
| Represents the const reference of params value type.
|
|
using | const_pointer = const value_type * |
| Represents the const pointer of params value type.
|
|
using | size_type = typename base_type::size_type |
| Represents the params size type (usually xtd::size).
|
|
using | iterator = typename base_type::iterator |
| Represents the iterator of params value type.
|
|
using | const_iterator = typename base_type::const_iterator |
| Represents the const iterator of params value type.
|
|
|
| object ()=default |
| Create a new instance of the ultimate base class object.
|
|
virtual bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object.
|
|
virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type.
|
|
virtual type_object | get_type () const noexcept |
| Gets the type of the current instance.
|
|
template<typename object_t > |
xtd::uptr< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object.
|
|
template<typename object_a_t , typename object_b_t > |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal.
|
|
template<typename object_a_t , typename object_b_t > |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance.
|
|