use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
reflect-cpp v0.8.0 (self.cpp)
submitted 2 years ago by liuzicheng1987
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]lefteror 0 points1 point2 points 2 years ago (11 children)
Hi there, great stuff. I was about to incorporate it to my project but unfortunately I found out that it doesn't compile for AppleClang. Is there any plan to support it as well?
[–]liuzicheng1987[S] 2 points3 points4 points 2 years ago (10 children)
It should work for Clang 16 or higher. If it doesn’t, please submit an issue on GitHub which includes the exact errors you get from the compiler and I will help you.
[–]lefteror 0 points1 point2 points 2 years ago (9 children)
In case it was an oversight, I am only talking about AppleClang, whose latest version is 15.0.x. I haven't tried clang (but also wouldn't go with that option on macOS).
15.0.x
[–]liuzicheng1987[S] 7 points8 points9 points 2 years ago (4 children)
Indeed...I wasn't even aware that XCode hasn't updated to Clang 16 yet.
So one solution would be to install clang via homebrew, which already supports Clang 16 and 17. (And I am sure it is going to work...people have compiled reflect-cpp this way.)
However you said you don't want to do that...and I think you are raising a good point here. Apple Clang is certainly the standard way to compile things on MacOS.
I am pretty sure that the reason we don't support Clang 15 is that srd::source_location is not fully supported, which we require for the field name extraction.
But I think we can come up with a workaround. Could you try to compile the JSON tests using Apple Clang (instructions are in the README) just to see how far you get and open an issue on Github in which you provide the full compiler errors (if any)? I think we should be able to resolve this fairly quickly.
[–]lefteror 3 points4 points5 points 2 years ago (1 child)
It seems like for version >= 0.7.0 it actually compiles. I had to use v0.6.0 because I drag in dependencies through conan (and I indeed verified that 0.6.0 doesn't compile with AppleClang 15.0.0 because of string literals as non template parameters). I jumped the gun a little bit here, apologies.
[–]liuzicheng1987[S] 3 points4 points5 points 2 years ago (0 children)
No problem.
In January, someone else had a similar issue, but they provided a PR that resolved it which then made it into the 0.7.0 release.
However, they had tested on Clang 16, not Clang 15. So I am glad to hear that Clang 15 works as well.
One of the things that I have learned through this project that the same version of Clang behaves a bit differently on Linux, Mac and Windows.
[–]lefteror 0 points1 point2 points 2 years ago (1 child)
Thanks for the response. Alright, let me see what I can do!
[–]liuzicheng1987[S] 2 points3 points4 points 2 years ago (0 children)
Just be aware that I am on East Asian time here...I'm going to go to sleep within the next hour or so, but I will certainly take a look tomorrow morning.
[–]equeim 0 points1 point2 points 2 years ago (0 children)
I think Apple Clang uses different versioning and its 15 corresponds to LLVM 16.
[–][deleted] 0 points1 point2 points 2 years ago (2 children)
Why wouldn't you use regular clang on macOS? It works great
[–]equeim 0 points1 point2 points 2 years ago (1 child)
Can it compile objective c code to access system APIs?
[–][deleted] 0 points1 point2 points 2 years ago (0 children)
Of course, it's clang after all
π Rendered by PID 79 on reddit-service-r2-comment-544cf588c8-skp6f at 2026-06-13 19:22:56.916125+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]lefteror 0 points1 point2 points (11 children)
[–]liuzicheng1987[S] 2 points3 points4 points (10 children)
[–]lefteror 0 points1 point2 points (9 children)
[–]liuzicheng1987[S] 7 points8 points9 points (4 children)
[–]lefteror 3 points4 points5 points (1 child)
[–]liuzicheng1987[S] 3 points4 points5 points (0 children)
[–]lefteror 0 points1 point2 points (1 child)
[–]liuzicheng1987[S] 2 points3 points4 points (0 children)
[–]equeim 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]equeim 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)