New answers tagged reflection
5 votes
Accepted
Using C++26 reflection to design a concept to check, by name, if a class has a given member function
^^Sig doesn't give you the meta::info of the original function type out(in...), but rather its type alias. You can directly extract the info of the function type out(in...) with: if (std::meta::...
12 votes
Accepted
Mirroring C++ Lambda Captures into a POD struct via C++26 Reflection (P2996)
This behavior is currently implementation-defined. Per [meta.reflection.member.queries], nonstatic_data_members_of(r, ctx) (where r is the reflection of a class or namespace Q) returns reflections of ...
0 votes
How to add a string literal annotation to items?
Another option that does not require consteval is to template the size of the string literal: struct Label { const char* msg; }; template <size_t N> constexpr Label label(const char (&...
2 votes
Is there a way to get a ref struct property using reflection?
This may not meet your use case, but I suspect it will. Rather than returning the value, you can stick within the spirit of the ref struct rules by consuming the value without it leaving the stack. ...
1 vote
Is there a way to get a ref struct property using reflection?
I don't think there is a (easy and flexible) way of accessing a ref struct property (in this reflection-like manner) without knowing the return type at compile time, via a type parameter. Honestly, ...
2 votes
Accepted
Unable to call private method for System.Security.Cryptography.X509Certificates.SubjectAlternativeNameBuilder
The first bug I can see is: the method you are looking for AddGeneralName does not exist, or it is non-public. But you are looking for this method as it was public, because the default for System.Type....
Top 50 recent answers are included
Related Tags
reflection × 25348c# × 11117
java × 7546
.net × 3204
generics × 2058
scala × 1045
go × 780
android × 692
types × 572
class × 547
annotations × 506
php × 477
kotlin × 464
linq × 447
dynamic × 429
vb.net × 426
properties × 398
interface × 353
lambda × 350
inheritance × 345
asp.net × 337
casting × 334
attributes × 332
c++ × 327
methods × 321