[[nodiscard]]: try to get around an issue with VS2017 (see #501)
This commit is contained in:
@@ -38,7 +38,7 @@ struct monostate {
|
||||
* @return Stored value, if any.
|
||||
*/
|
||||
template<typename Type>
|
||||
[[nodiscard]] operator Type() const ENTT_NOEXCEPT {
|
||||
operator Type() const ENTT_NOEXCEPT {
|
||||
return value<Type>;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ struct as_view {
|
||||
* @return A newly created view.
|
||||
*/
|
||||
template<typename Exclude, typename... Component>
|
||||
[[nodiscard]] operator entt::basic_view<Entity, Exclude, Component...>() const {
|
||||
operator entt::basic_view<Entity, Exclude, Component...>() const {
|
||||
return reg.template view<Component...>(Exclude{});
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ struct as_group {
|
||||
* @return A newly created group.
|
||||
*/
|
||||
template<typename Exclude, typename Get, typename... Owned>
|
||||
[[nodiscard]] operator entt::basic_group<Entity, Exclude, Get, Owned...>() const {
|
||||
operator entt::basic_group<Entity, Exclude, Get, Owned...>() const {
|
||||
return reg.template group<Owned...>(Get{}, Exclude{});
|
||||
}
|
||||
|
||||
|
||||
@@ -57,16 +57,24 @@ public:
|
||||
}
|
||||
|
||||
/*! @copydoc get */
|
||||
[[nodiscard]] operator const Resource & () const ENTT_NOEXCEPT { return get(); }
|
||||
[[nodiscard]] operator const Resource & () const ENTT_NOEXCEPT {
|
||||
return get();
|
||||
}
|
||||
|
||||
/*! @copydoc get */
|
||||
[[nodiscard]] operator Resource & () ENTT_NOEXCEPT { return get(); }
|
||||
[[nodiscard]] operator Resource & () ENTT_NOEXCEPT {
|
||||
return get();
|
||||
}
|
||||
|
||||
/*! @copydoc get */
|
||||
[[nodiscard]] const Resource & operator *() const ENTT_NOEXCEPT { return get(); }
|
||||
[[nodiscard]] const Resource & operator *() const ENTT_NOEXCEPT {
|
||||
return get();
|
||||
}
|
||||
|
||||
/*! @copydoc get */
|
||||
[[nodiscard]] Resource & operator *() ENTT_NOEXCEPT { return get(); }
|
||||
[[nodiscard]] Resource & operator *() ENTT_NOEXCEPT {
|
||||
return get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets a pointer to the managed resource.
|
||||
|
||||
Reference in New Issue
Block a user