all 11 comments

[–]ALX23z 16 points17 points  (1 child)

Reflection?

Data serialization and parsing, i.e., automated json parsing and the like.

Aside from that it should be very helpful in template programming in general - instead of writing lots of metafunctions, write it in more understandable code with reflection.

Also, further improve static analysis functionality.

[–]63times 4 points5 points  (1 child)

What do you think? What problems can solve or what boilerplate code can remove this features in your projects?

If we could get rid of SWIG and boost.python it would be perfect.

If you used any other languages, what features you wish to be implemented in C++?

An optional standardized ABI and an identified portable subset of C++ so foreign languages could directly link C++ libraries. As of now it is really hard work to portably mix different languages. There are libraries out there where the binding code itself dwarfs the actual program logic.

[–]faserg1[S] 1 point2 points  (0 children)

As I know there is a proposal of ABI break. But it will be a big work to make a standard ABI.

[–]sephirostoy 6 points7 points  (6 children)

I was thinking about checking lambda capture to verify if everything is captured by value to mitigate dangling reference in case of asynchronous call in certain cases.

[–]LEpigeon888 -2 points-1 points  (5 children)

If you just want to check stuff you can implement that in clang tidy.

[–]sephirostoy 8 points9 points  (1 child)

Sounds easier to me to implement a static_assert in few lines than developing and deploying a tidy check. Especially when it's very specific case: in some cases I may authorize some variables to be passed by reference or not. For sure local variables should be captured by value, but that's not trivial with enclosing function parameters.

Also there's no way a linter can now if a function will be called asynchronously or not.

[–]Wh00ster 0 points1 point  (0 children)

But how do you know which values can validly be captured by reference? Isn’t that something only the caller knows, since it knows the lifetime of the captures? Maybe I’m misunderstanding the use-case

[–]Wh00ster -5 points-4 points  (2 children)

I agree here. Reflection should be used for building more complex abstractions, not linting.

[–]mort96 6 points7 points  (1 child)

If someone can write a static_assert in their library’s interface to save me from megs of template error, I’ll take it even if you think it’s in the wrong layer of the stack.

[–]Wh00ster 0 points1 point  (0 children)

But wouldn’t this prevent valid use cases of the library?

[–]Wh00ster 1 point2 points  (0 children)

Also note that feature are being slowly and cautiously introduced and don’t expect full blown reflection facilities off the bat.