6#include "../../object.hpp"
7#include "../../iequatable.hpp"
8#include "../../static.hpp"
9#define __XTD_CORE_INTERNAL__
10#include "../../internal/__key_value_pair_definition.hpp"
11#undef __XTD_CORE_INTERNAL__
18 namespace collections {
36 template <
class key_t,
class value_t>
65 template <
class key_type_t,
class value_type_t>
76 template<
class... args1_t,
class... args2_t>
77 key_value_pair(std::piecewise_construct_t, std::tuple<args1_t...> first_args, std::tuple<args2_t...> second_args) :
first {first_args},
second {second_args} {}
97 const key_t&
key() const noexcept {
return first;}
128 operator std::pair<key_t, value_t>() const noexcept {
return {
first,
second};}
158 template<
class key_t,
class value_t>
166 template<
class key_t,
class value_t>
167 key_value_pair(key_t, value_t) -> key_value_pair<key_t, value_t>;
Represents text as a sequence of character units.
Definition basic_string.hpp:71
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:43
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.hpp:37
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
static key_value_pair< key_t, value_t > create(key_t key, value_t value)
Creates a key_value_pair from specified key and value.
Definition key_value_pair.hpp:159
Defines a key/value pair that can be set or retrieved.
Definition key_value_pair.hpp:37
key_value_pair()=default
Initializes a new instance of the key_value_pair<key_t, value_t> class with the default key and value...
bool equals(const key_value_pair &value) const noexcept override
Determines whether the specified object is equal to the current object.
Definition key_value_pair.hpp:115
key_value_pair(std::piecewise_construct_t, std::tuple< args1_t... > first_args, std::tuple< args2_t... > second_args)
Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified first_args ...
Definition key_value_pair.hpp:77
value_t value_type
Representd the type of the value.
Definition key_value_pair.hpp:46
key_value_pair(const key_t &key, const value_t &value)
Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified key and val...
Definition key_value_pair.hpp:61
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
Definition key_value_pair.hpp:110
value_t second
Gets or sets the value in the key/value pair.
Definition key_value_pair.hpp:93
key_value_pair(const std::pair< key_t, value_t > &value)
Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified key and val...
Definition key_value_pair.hpp:69
key_t key_type
Represents the type of the key.
Definition key_value_pair.hpp:44
key_value_pair(key_type_t &&key, value_type_t &&value)
Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified key and val...
Definition key_value_pair.hpp:66
const key_t & key() const noexcept
Gets the key in the key/value pair.
Definition key_value_pair.hpp:97
key_t first
Gets or sets the key in the key/value pair.
Definition key_value_pair.hpp:91
key_value_pair(std::pair< key_t, value_t > &&value)
Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified key and val...
Definition key_value_pair.hpp:72
xtd::string to_string() const noexcept override
Returns a String representation of the key_value_pair<key_t, value_t>, using the String representatio...
key_type first_type
Represents the type of the first.
Definition key_value_pair.hpp:48
const value_t & value() const noexcept
Gets the value in the key/value pair.
Definition key_value_pair.hpp:101
value_type second_type
Represents the type of the second.
Definition key_value_pair.hpp:50
std::pair< key_t, value_t > base_type
Represents the type of the base.
Definition key_value_pair.hpp:42