Function operator==

Summary

#include <src/entt/entity/entity.hpp>

(1) constexpr bool operator==([[maybe_unused]] const null_t other) const

(2) template <typename Entity>
    constexpr bool operator==(const Entity entity) const

Function overload

Synopsis

#include <src/entt/entity/entity.hpp>

constexpr bool operator==([[maybe_unused]] const null_t other) const

Description

Compares two null objects.

Parameters

other - A null object.

Returns
True in all cases.

Source

Lines 179-181 in src/entt/entity/entity.hpp.

[[nodiscard]] constexpr bool operator==([[maybe_unused]] const null_t other) const ENTT_NOEXCEPT {
    return true;
}

Synopsis

#include <src/entt/entity/entity.hpp>

template <typename Entity>
constexpr bool operator==(const Entity entity) const

Description

Compares a null object and an identifier of any type.

Template Parameters

Entity - Type of identifier.

Parameters

entity - Identifier with which to compare.

Returns
False if the two elements differ, true otherwise.

Source

Lines 198-202 in src/entt/entity/entity.hpp.

template<typename Entity>
[[nodiscard]] constexpr bool operator==(const Entity entity) const ENTT_NOEXCEPT {
    using entity_traits = entt_traits<Entity>;
    return entity_traits::to_entity(entity) == entity_traits::to_entity(*this);
}





Add Discussion

Log in to comment