#include <xtd/xtd>
public:
order_order_line(int order_id, int order_line_id) : order_id_ {order_id}, order_line_id_ {order_line_id} {}
int order_id() const noexcept {return order_id_;}
int order_line_id() const noexcept {return order_line_id_;}
bool equals(
const order_order_line& other)
const noexcept override {
return order_id_ ==
other.order_id_ && order_line_id_ ==
other.order_line_id_;}
size get_hash_code() const noexcept
override {
return hash_code::combine(order_id_, order_line_id_);}
private:
int order_id_ = 0;
int order_line_id_ = 0;
};
auto main() -> int {
auto set = hash_set<order_order_line> {
order_order_line {1, 1},
order_order_line {1, 1},
order_order_line {1, 2}
};
console::write_line("Item count: {}.", set.size());
}
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
virtual bool equals(const object &obj) const noexcept
Determines whether the specified object is equal to the current object.
object()=default
Create a new instance of the ultimate base class object.
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
bool is(xtd::any value)
Checks if the result of an expression is compatible with a given type.
Definition is.hpp:485
@ other
The operating system is other.
Definition platform_id.hpp:58
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
Definition read_only_span.hpp:296