Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 26 22:23

    skypjack on wip

    natvis: make the ecs stuff work… (compare)

  • Nov 26 16:15

    skypjack on wip

    natvis: added simple views + mi… natvis: when you discover the i… natvis: tombstone/null and 3 more (compare)

  • Nov 25 08:22

    skypjack on dll

    (compare)

  • Nov 25 08:22

    skypjack on stamp_is_back

    (compare)

  • Nov 25 08:22

    skypjack on wip

    dispatcher: make it run smoothl… emitter: make it run smoothly a… registry: make it run smoothly … and 33 more (compare)

  • Nov 24 13:30

    skypjack on stamp_is_back

    storage: clean up registry: turn storage_type in … view: minor changes and 1 more (compare)

  • Nov 24 09:15

    skypjack on stamp_is_back

    meta: try to suppress a wrong w… (compare)

  • Nov 24 08:18

    skypjack on stamp_is_back

    registry: * public and runtime … registry: decouple ::storage/::… helper: make to_entity also wor… and 2 more (compare)

  • Nov 22 10:41

    skypjack on dll

    (compare)

  • Nov 20 12:00

    skypjack on stamp_is_back

    registry: try to also please vs… (compare)

  • Nov 20 11:52

    skypjack on stamp_is_back

    registry: minor changes/cleanup (compare)

  • Nov 20 11:29

    skypjack on stamp_is_back

    natvis: minor changes natvis: delegate, sigh, sink, c… (compare)

  • Nov 20 10:30

    skypjack on stamp_is_back

    registry: removed pdata contain… (compare)

  • Nov 20 09:07
    skypjack labeled #800
  • Nov 20 09:07
    skypjack assigned #800
  • Nov 20 09:07
    skypjack labeled #799
  • Nov 20 09:06
    skypjack assigned #799
  • Nov 20 08:53
    BrodyHiggerson opened #800
  • Nov 20 07:56
    BrodyHiggerson edited #799
  • Nov 20 07:55
    BrodyHiggerson opened #799
Michele Caini
@skypjack
It's not an issue in EnTT
When you delete the copy constructor, the move one isn't generated anymore
You should default it
Being copy movable is the only requirement and your type is not movable
The function is fine already, it can be improved to avoid the move but still, it won't work anyway with your type unless you make it movable
Eric Tremblay
@erictcan:matrix.org
[m]
Hello, thank you for taking the time to look at this. I have defaulted the move constructor in my example and it does work. I will give it a try with the actual code probably tomorrow or on Monday. Thanks again!!
Michele Caini
@skypjack
:+1: please, let me know. Thanks.
Eric Tremblay
@erictcan:matrix.org
[m]
I got a chance to give it a try with the actual code and even though I defaulted the move constructor I still encountered a problem. A member of one of my classes has its copy constructor deleted and I cannot modify the class of this member since it is not under my control. But if I use the line of code you told me to replace in meta/utility.hpp everything works like a charm and I don't even need to default the move constructor 😀 Were you going to do this optim anyhow? Let me know.
Eric Tremblay
@erictcan:matrix.org
[m]
I uploaded a slightly modified version to show the problem I encountered. If you uncomment the deleted copy constructor from the TroubleMaker class you will see that the code does not compile anymore.
Michele Caini
@skypjack
Ahaha yeah, it's already upstream actually, on a branch that will join master soon
Thanks for the feedback, let me look into your example
Ah, well, you can still manually define the move ctor/oper of your class so that it gets around the limitations of the underlying class, if you like
Though, yeah, that line will change upstream in any case :slight_smile:
Saad K
@samaursa
@skypjack is there perchance a high level diagram of the memory model used by entt that shows how the components are laid out in memory and how the groups/views are constructed for efficient component access?
Michele Caini
@skypjack
@samaursa have you already read the ecs back and forth series here? https://skypjack.github.io/
It contains tons of details on this topic, I dare to say all you need to reimplement EnTT at its current version or so
Saad K
@samaursa

I somehow missed those articles - thanks for pointing them out Michele, will give them a read

I do remember reading a couple of them - seems like I missed some in the series

Alexander
@alexander-v
Hello.
Is it the expected behaviour that in case of holding a reference any::data() returns pointer to std::reference_wrapper<T> instead of pointer to T?
Michele Caini
@skypjack
What do you mean with holding a reference?
You cannot hold a reference with a any, so I barely get what you mean honestly
Do you have a repro for it?
Alexander
@alexander-v
i meant holding std::reference_wrapper<T>
I updated entt and behaviour changed
entt::meta_any any(std::ref(x))
it seems previously any.data() returned &x
probably it was wrong to assume this behaviour
Michele Caini
@skypjack
Oh, yeah and it wasn't possible to store reference wrappers, so the API changed a little a few versions ago
You've a few alternatives to do the same now, none of them uses reference wrappers
auto any = entt::forward_as_meta(x);
Or with std::in_place_type
entt::meta_any any{std::in_place_type<T &>, x};
Otherwise you can emplace it as a reference once the any is constructed
any.emplace<T &>(x);
And so on, the doc in the wiki is up-to-date
If you put an std::reference_wrapper in a meta_any, it stores it as is now
Michele Caini
@skypjack
And ofc data returns &x when you use the aliasing constructor, it wasn't wrong to assume it :slight_smile:
Alexander
@alexander-v
thank you, this solves my problem
Michele Caini
@skypjack
You're welcome
Jaymie Xu
@JaymieX

Hello im new here and bit of a noob, I was wondering if im doing something wrong here with entt signals and delegates.

entt::signal<void(IEvent&&)> m_eventCallBackSignal;
entt::sink<void(IEvent&&)>   m_eventCallbackSink{ m_eventCallBackSignal };

And when I use it:

m_eventCallBackSignal.publish(MouseWheelEvent(arg1, arg2)); // this should already b rval

I get an error:
'Ret entt::delegate<Ret (Common::IEvent &&)>::operator ()(Common::IEvent &&) const': cannot convert argument 1 from 'Common::IEvent' to 'Common::IEvent&&'

I manage to go around it for now by changing the publish function to

void publish(Args... args) const {
   for(auto &&call: std::as_const(calls)) {
       call(std::forward<Args>(args)...); // basiclly added forward here
   }
}

Errors gone and everything seem to work on the surface so far. But still curious if i made a mistake on my own code, since really shouldn't be touching the entt lib code

Michele Caini
@skypjack

m_eventCallBackSignal.publish(MouseWheelEvent(arg1, arg2)); // this should already b rval

I think this is the culprit. It's an rvalue but it's not and rvalue reference, that is what the function expects.

Michele Caini
@skypjack
Great, thanks for the heads-up @green:g-s.xyz
In the meantime, I've updated the EnTT v3.9 changelog preview: https://github.com/skypjack/entt/discussions/740
It's getting huge and we're getting closer and closer to the next release finally :slight_smile:
Green-Sky
@green:g-s.xyz
[m]
ah yes, I wanted to ask when the next release is up :'D
Michele Caini
@skypjack
We're close to it :heart: almost a Christmas gift at this point :sweat_smile:
Green-Sky
@green:g-s.xyz
[m]
hey, is there an easy way to detect deleted components with the observer?
my goal here is to track created, updated and deleted components
but afaik the observer does not do the last
Michele Caini
@skypjack
Sorry @green:g-s.xyz missed the message as I was out in the afternoon
I think you're right btw, the matcher has not a deleted-only hook :sweat_smile: