C++ Has Reflection Now??? [Reflective Serialization]

Поділитися
Вставка
  • Опубліковано 22 січ 2025

КОМЕНТАРІ • 21

  • @jamestanny849
    @jamestanny849 24 дні тому +5

    I should get back on the beginner tutorial, I've might gone a bit too far here

    • @ChiliTomatoNoodle
      @ChiliTomatoNoodle  23 дні тому

      When you accidentally step into the wrong end of the pool.

    • @n00blamer
      @n00blamer 21 день тому

      @@ChiliTomatoNoodle yeye how hard can swimming be.. blub blub blub.. help

  • @noname_2108
    @noname_2108 24 дні тому

    Hello chili, I’m checking out this video after writing my own game engine along with your series of dx11 (been 1 year ago), learning how to do stuff. After that I’ve been programming using UE5, powerful engine, learnt reflection stuff there. And now I finally work, use my knowledge and earn money. Wanted to say big thanks!
    C++ standard reflection system would be nice though.

    • @ChiliTomatoNoodle
      @ChiliTomatoNoodle  23 дні тому

      Congrats on your success!

    • @fangornthewise
      @fangornthewise 15 днів тому

      Hopefully that will be me soon. May I ask where or with what you're working?

  • @almondengine
    @almondengine 24 дні тому

    Can't wait to try this!

    • @ChiliTomatoNoodle
      @ChiliTomatoNoodle  23 дні тому

      It's surprisingly easy to work with and light to include.

    • @almondengine
      @almondengine 23 дні тому

      @@ChiliTomatoNoodle super light.. it's already in type_traits and you can use
      Example: Using constexpr for Compile-Time Reflection
      C++20 enables compile-time type introspection using constexpr and type traits.
      Example: Reflecting Member Variables with The Boost.PFR library allows introspection of plain-old-data (POD) types without macros or boilerplate.
      Example: Using std::tuple for Reflection
      Example: Type Traits for Reflection
      3 ways even without boost

    • @almondengine
      @almondengine 23 дні тому

      @@ChiliTomatoNoodle Dynamic Reflection vs. Static Reflection
      Dynamic Reflection (not natively in C++)
      The ability to inspect or manipulate type structures at runtime, even if their layout is unknown beforehand. For example, in Java or Python, you can iterate over class members dynamically because these languages maintain rich runtime type metadata.
      Static Reflection (available in C++20)
      The ability to introspect types at compile time, assuming the structure is already known or determined by the programmer. This is often more efficient and safer than dynamic reflection but less flexible.

  • @michaelhawthorne5516
    @michaelhawthorne5516 18 днів тому

    I wrote a helper tool that interprets a minimal syntax data description language and generates h/cpp files that provide reflectivity for each type.
    It works but maintenance is too much for me. It feels too complicated when I just wanna make game go

    • @ChiliTomatoNoodle
      @ChiliTomatoNoodle  18 днів тому

      @@michaelhawthorne5516 for types that don't work with the structured binding reflection trick, I have a c# tool based on cppast (clang) that parses the cpp code and generates whatever I need

    • @michaelhawthorne5516
      @michaelhawthorne5516 18 днів тому

      @@ChiliTomatoNoodle very cool! I'll give cppast a look. Thanks for the tip

  • @PedroOliveira-sl6nw
    @PedroOliveira-sl6nw 25 днів тому

    6:00 I would laugh so hard if this was the end of the video and of the series.

    • @PedroOliveira-sl6nw
      @PedroOliveira-sl6nw 25 днів тому

      Also: The ending is back!!! YAY
      It feels like Xmas with so many videos.
      Thanks a lot Chili! I love your content!
      If you don't do anything until next year, wishing you a great 2025!

    • @ChiliTomatoNoodle
      @ChiliTomatoNoodle  24 дні тому

      @@PedroOliveira-sl6nw happy me years bro! if it were April 1st that would have been an amazing end at 6:00 :].

    • @ChiliTomatoNoodle
      @ChiliTomatoNoodle  24 дні тому +1

      New years kek

  • @jonahmatteson
    @jonahmatteson 25 днів тому +2

    Is it true?!??

    • @ChiliTomatoNoodle
      @ChiliTomatoNoodle  24 дні тому +1

      @@jonahmatteson kind of

    • @jonahmatteson
      @jonahmatteson 23 дні тому +1

      @ I have been waiting for built in reflection for so long. Though the library you use seems pretty good, compared to most things I have used/looked at. Might give it a try.

  • @alstjd0808
    @alstjd0808 24 дні тому

    noice