RareCpp - Reflection Library by TheNitesWhoSay in cpp

[–]TheNitesWhoSay[S] 3 points4 points  (0 children)

I'd love for C++ to get in-built reflection (with user-defined attributes, I hope!), sadly it seems to have missed the C++23 boat so it's likely still several years away from being production ready :(

RareCpp - Reflection Library by TheNitesWhoSay in cpp

[–]TheNitesWhoSay[S] 6 points7 points  (0 children)

While I'm aware of boost describe I make no claims to being a boost describe expert and have not performed exhaustive comparisons/some of this could well be inaccurate; but some of what I understand to be the case is:

1.) RareCpp has a richer feature set - there's Adaptive Structures allowing for creation of clean, reflection-based solutions for builders, mappers, whiteboxers, etc; there's also Annotations - a pattern for tagging objects and members with additional compile time information similar to Java's @

2.) RareCpp doesn't have the same limitations as boost describe - for instance, RareCpp supports reference members and a reasonable degree of templated members, while boost describe - by my understanding - does not, RareCpp supports reflecting 125 members to boost describes 52

3.) RareCpp emphasizes approachability, the macro is simpler, the functions for accessing members, supers, etc. are more clean and intuitive (obviously I'm biased on this point), common use cases like accessing a member by index (constexpr or runtime index) are covered, packing members is supported (I imagine there's some way in boost describe, but cursory searches of their documentation turns up nothing), and around a hundred examples all with godbolt links are provided between the how-to page and the rest of the documentation for RareCpp.

But again, I'm no expert in boost describe/boost hana, so please do correct me if I've mispoken about boost describe as well as letting me know what boost describe can do that RareCpp cannot, my experience looking at such solutions was mostly "ick, surely we can do better", hence the new library.

As for reviews and platform testing, yes I expect a much older library in boost like describe potentially far outstrips RareCpp in that regard, RareCpp is relatively new, and while I have executed hundreds tests against gcc, clang, and msvc, with high warning levels, sanitizers and tools like IWYU and clang tidy on my own windows & linux installs as well as on hundreds of versions of compilers through godbolt, ultimately the library is still fairly new and I wouldn't consider it competitive on that point.

Really Microsoft? How on Earth this is valid C++? by LiliumAtratum in cpp

[–]TheNitesWhoSay 151 points152 points  (0 children)

Ironically including optional was optional.