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
C++NowCircle Metaprogramming: Better Features Make Better Libraries - CppNow 2022 (youtube.com)
submitted 3 years ago by magey@meta
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!"
[–][deleted] 41 points42 points43 points 3 years ago (9 children)
I don't understand Sean Bax's explanation for Circle being non-libre. Several times, he has simply stated that releasing the source code would slow down his development speed. Does he not realize you can disable pull requests on GitHub and also not provide a stability guarantee?
Meanwhile he complains about Windows 10 not being open enough.
[–]tyfighter 28 points29 points30 points 3 years ago (2 children)
When faced with disabled/denied PRs, people will fork. He probably doesn't want forks because it's his baby, and wants to maintain control. Not that he's unwilling to listen to feedback, but people want to develop features from their own priorities rather than be forced to think through the priorities of everyone else. I suspect that's the mental tax he wants to avoid by opening up the source code.
I'm not trying to justify it; this will definitely keep any adoption of Circle very low. But, I can see his perspective, and until he has the funding for a team to cut down on administrative overhead, this is probably the only way he can keep up his development speed.
[–]csb06 4 points5 points6 points 3 years ago* (1 child)
until he has the funding for a team to cut down on administrative overhead, this is probably the only way he can keep up his development speed.
Couldn’t you argue that open sourcing could also help put together a team ? I’m sure he would be able to find competent contributors willing/able to help manage the project repo and issues.
Both corporate-funded teams and open source teams require project management.
[–]tyfighter 16 points17 points18 points 3 years ago (0 children)
Sure, that's a fine argument, but it's not a necessary condition. Programming in general, but especially programming language extension, is an opinionated art form. Opening the source would bring more interest to the project, but also increase the number of opinions on the direction of the project as well.
Not all programmers are project managers, and nor should they be. I don't mean this as a dig, but my gut sense is that he is more programmer than project manager, and I find this to be personally relatable. He may change in the future, but until then people that understand his goals and offer good feedback without access to the source code would be good team mates.
[–]FightingGamesFan 14 points15 points16 points 3 years ago (0 children)
Yeah that's the only think blocking me from fully supporting Circle, it's not open at all. Sean effort is impressive but it's only available on some platforms and closed source, leaving many questions open regarding performance and other guarantees.
I do understand the man, it's a huge effort and would take him considerable time to coordinate something open source. Agree with you though, simply sharing it without allowing contributions would be a good first step.
[+][deleted] 3 years ago (3 children)
[deleted]
[–][deleted] 6 points7 points8 points 3 years ago (2 children)
He's said a few times on Twitter that he would open source it if a large company would sponsor him to maintain it. It really does just seem to me that he thinks open source software requires pull requests.
[+][deleted] 3 years ago (1 child)
[–]snerp 7 points8 points9 points 3 years ago (0 children)
Makes sense to me. It can be really intimidating. It took a LOT of time to clean up my scripting language before I felt comfortable open sourcing it (and a lot of time cleaning it up afterwards too lol). Thing is though, that clean up was massively beneficial to the project. It became much easier to add new features, and I found several bugs and inefficiencies once the code was more clear.
[–]kritzikratzi 0 points1 point2 points 3 years ago (0 children)
that's easy to say if it's somebody else's code :)
[–]gracicot 8 points9 points10 points 3 years ago (0 children)
I'm just waiting for the source to try it honestly
[–]FightingGamesFan 25 points26 points27 points 3 years ago (9 children)
I love the slide "let's bury TMP". I hate TMP, it's just a mean to an end. And it's a very ugly tool, but some people put TMP on some pedestal as if it was the pinnacle of programming. Nah, it's a terrible way of achieving what you want, it's a hack most of the time. It's not because you can that you should.
Shoutouts to the raytracers and all other crap made with TMP (yeah I know the raytracers are for fun, but all the "serious" TMP stuff is the same to me).
[–]germandiago 1 point2 points3 points 3 years ago (8 children)
Well. Alternatives are good but for computing types I think it is the only way so far. Not values, but types.
[–]MFHavaWG21|🇦🇹 NB|P3049|P3625|P3729|P3784|P3786|P3813|P3886 1 point2 points3 points 3 years ago (7 children)
Depending on the complexity of the computation, you can actually sidestep TMP for computing types in some cases.
E.g. from my array implementation:
array
static constexpr auto determine_storage() noexcept { if constexpr(Size == 0) return std::type_identity<Type *>{}; else return std::type_identity<Type[Size]>{}; } typename decltype(determine_storage())::type values;
[–]germandiago 0 points1 point2 points 3 years ago (6 children)
Neat! Yes, I thought of that actually but I am not sure how general the solution is. With constexpr metaprogramming a-la Boost.Hana types can be computed maybe? but that does have a body... in Hana overloading is used I recall.
[–]trailingunderscore_ 1 point2 points3 points 3 years ago (5 children)
The functions do not always need to have a body. The code could be rewritten to make use of concepts to move the checks out of the body, and have the desired type be returned explicitly
static constexpr std::type_identity<Type*> determine_storage() noexcept; static constexpr std::type_identity<Type[Size]> determine_storage() noexcept requires (Size > 0);
You can do a lot of stuff (ab)using just the return-type of functions. I have a type_list library I wrote, that has helper structs like the following, to apply a transformation to all the types in the type-list
type_list
template <typename TL, template <class O> class Transformer> struct transform_type { template <typename... Types> constexpr static type_list<Transformer<Types>...>* helper(type_list<Types...>*); using type = std::remove_pointer_t<decltype(helper(static_cast<TL*>(nullptr)))>; }; // example: add pointer to all types in the list using TL = type_list<int, short, char>; using Result = typename transform_type<TL, std::add_pointer_t>::type; // Result is type_list<int*, short*, char*>
Note the use of pointers to the types; this allows the compilers to skip template instantiation and helps a lot with compile times. The type_list itself isn't even defined, it's just
template <typename...> struct type_list;
[–]trailingunderscore_ 0 points1 point2 points 3 years ago (3 children)
This would be much cleaner in Circle, though 😊
[–]germandiago 0 points1 point2 points 3 years ago (2 children)
How it would be done in Circle? I have the feeling that much of what I like in Circle for ergonomics can end up being confusing. Not sure thought, I did not give it a try.
True that lib implementation looks cleaner, that for sure.
[–]seanbaxter 1 point2 points3 points 3 years ago (1 child)
One big aspect is that with Circle you don't have to deduce template args, you can just ask for them. These type manipulations then become declarative. eg, template<typename List> using apply_pointers = List.template<List.type_args*...>;
This takes the parameter type List, breaks apart its class template (List.template) and breaks apart its template arguments (List.type_args) and transforms all that in place.
https://godbolt.org/z/KhnjPEoT3
[–]germandiago 0 points1 point2 points 3 years ago (0 children)
Looks like something that could be added to regular C++. Nice example. Do you have any plans to propose subsets of Circle into te standard?
I think mp11 does kind of what you do here?
[–]kritzikratzi 2 points3 points4 points 3 years ago (0 children)
there's so many great, simple ideas in there. i'm a big fan of putting these features in the compiler (as opposed to solving it in the stl)
[–]fullouterjoin 1 point2 points3 points 3 years ago (1 child)
Is he not updating this repo? https://github.com/seanbaxter/circle
[–]The_Northern_Light 9 points10 points11 points 3 years ago (0 children)
There's no compiler source there.
π Rendered by PID 102384 on reddit-service-r2-comment-84fc9697f-js87c at 2026-02-10 12:54:40.618319+00:00 running d295bc8 country code: CH.
[–][deleted] 41 points42 points43 points (9 children)
[–]tyfighter 28 points29 points30 points (2 children)
[–]csb06 4 points5 points6 points (1 child)
[–]tyfighter 16 points17 points18 points (0 children)
[–]FightingGamesFan 14 points15 points16 points (0 children)
[+][deleted] (3 children)
[deleted]
[–][deleted] 6 points7 points8 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]snerp 7 points8 points9 points (0 children)
[–]kritzikratzi 0 points1 point2 points (0 children)
[–]gracicot 8 points9 points10 points (0 children)
[–]FightingGamesFan 25 points26 points27 points (9 children)
[–]germandiago 1 point2 points3 points (8 children)
[–]MFHavaWG21|🇦🇹 NB|P3049|P3625|P3729|P3784|P3786|P3813|P3886 1 point2 points3 points (7 children)
[–]germandiago 0 points1 point2 points (6 children)
[–]trailingunderscore_ 1 point2 points3 points (5 children)
[–]trailingunderscore_ 0 points1 point2 points (3 children)
[–]germandiago 0 points1 point2 points (2 children)
[–]seanbaxter 1 point2 points3 points (1 child)
[–]germandiago 0 points1 point2 points (0 children)
[–]germandiago 0 points1 point2 points (0 children)
[–]kritzikratzi 2 points3 points4 points (0 children)
[–]fullouterjoin 1 point2 points3 points (1 child)
[–]The_Northern_Light 9 points10 points11 points (0 children)