mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
srb2::MobjListView: relax constraint so basic mobj_t is allowed
This commit is contained in:
parent
4588943352
commit
df5d1e5fb5
1 changed files with 4 additions and 2 deletions
|
|
@ -14,15 +14,17 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include "mobj.hpp"
|
#include "p_mobj.h"
|
||||||
|
|
||||||
namespace srb2
|
namespace srb2
|
||||||
{
|
{
|
||||||
|
|
||||||
// for (T* ptr : MobjList(hnext(), [](T* ptr) { return ptr->hnext(); }))
|
// for (T* ptr : MobjList(hnext(), [](T* ptr) { return ptr->hnext(); }))
|
||||||
template <typename T, typename F, std::enable_if_t<std::is_convertible_v<T, Mobj>, bool> = true>
|
template <typename T, typename F>
|
||||||
struct MobjListView
|
struct MobjListView
|
||||||
{
|
{
|
||||||
|
static_assert(std::is_convertible_v<T, mobj_t>);
|
||||||
|
|
||||||
struct Iterator
|
struct Iterator
|
||||||
{
|
{
|
||||||
using iterator_category = std::forward_iterator_tag;
|
using iterator_category = std::forward_iterator_tag;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue