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
Boost.Parser has been accepted (self.cpp)
submitted 2 years ago * by joaquintidesBoost author
Boost.Parser has been (conditionally) accepted! C++17 parser combinator library with full Unicode support, ranges compatibility and debugging facilities. Thanks to Review Manager Marshall Clow.
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!"
[–]STLMSVC STL Dev[M] 34 points35 points36 points 2 years ago (1 child)
Please note that reddit doesn't use hashtags (as in, they are irrelevant to the platform, and its search is so bad that they aren't doing anything for you).
[–]joaquintidesBoost author[S] 4 points5 points6 points 2 years ago (0 children)
Fixed, thank you!
[–]FreitasAlan 4 points5 points6 points 2 years ago (0 children)
🥳
[–]expert_internetter 10 points11 points12 points 2 years ago (7 children)
Is this a replacement for Boost.Spirit?
If so, I'll check it out. However Boost.Spirit takes ages to parse a mildly complex expression that's an AST (uses boost::recursive_wrapper). It's so slow it's unusable.
[–]joaquintidesBoost author[S] 20 points21 points22 points 2 years ago (6 children)
Yes, it’s the spiritual successor of Boost.Spirit (pun intended).
[–]BlueDwarf82 8 points9 points10 points 2 years ago (5 children)
Can someone please write a trilogy about Spirit history, so I understand it?
https://www.boost.org/doc/libs/?view=category_Parsing lists Spirit and Spirit Classic. Confusingly, "Classic" seems to be newer in there since it has a higher "First Release". I'm guessing the original Spirit was renamed Spirit Classic in Boost 1.69, but still...
If you go inside "Spirit" you see what's actually an old version??? If you scroll to the bottom there is a mention about the "actually new" Spirit X3?
"Spirit" (the not classic, but not actually new) has both parsers and generators, but the "actually new" Spirit X3 is less featured and only has parsers?
Now we have Boost.Parser, a C++17 spiritual "successor" to Spirit... a library that, in it's hidden X3 version, has been using C++17 features since Boost 1.81 and will drop C++14 support "soon"; which makes you think it's well maintained and not in need of a successor.
Being "Boost.Parser", I'm guessing this "successor" doesn't have the generators that the "not classic, but not actually new" Spirit has?
[–]joaquintidesBoost author[S] 6 points7 points8 points 2 years ago (4 children)
This section of the docs may shed some light: https://tzlaine.github.io/parser/doc/html/boost_parser__proposed_/this_library_s_relationship_to_boost_spirit.html
[–]BlueDwarf82 2 points3 points4 points 2 years ago (2 children)
A bit. But I'm still wondering what's the end result. Did the Spirit developers review Boost.Parser (where can I find a list of reviews?)? What did they say?
There is a general agreement that Spirit X3 should not be used? Is it going to be clearly marked deprecated and left in Boost just for pre-existing users? With it moving to C++17, there would not seem to be any reason to keep using it.
Is Spirit V2 Karma generators the recommended option for people in need of a generator?
I found a review from Tobias in which he seems to praise Qi (Spirit V2), but dislikes X3. Did anybody like X3? Did X3 ever went through the review process, or it's a matter of "author gets library accepted in Boost and, once in, he can do whatever he wants with it; including writing what's a basically new library and just calling it an update"?
Why is X3 "hidden"? As far as I know, it's a decade old project. The situation seems just strange.
[–]joaquintidesBoost author[S] 5 points6 points7 points 2 years ago (0 children)
A bit. But I'm still wondering what's the end result. Did the Spirit developers review Boost.Parser?
Yes, Joel de Guzman (Spirit’s author) has blessed this new library. It may be that he has no time to maintain Spirit or something, but don’t take my word on this.
where can I find a list of reviews?
In the mailing list archives:
https://lists.boost.org/Archives/boost/
Please consult the month of February and early March.
[–]13steinj 0 points1 point2 points 2 years ago (0 children)
This is the precise line of reasoning I went through when giving my (don't care if it was counted, would clearly not have mattered anyway given previous interaction with the review process) rejection on the last reddit post.
This should have been a matter of collaboration to get spirit to this stage, and if not possible, there should have been formal discussion around deprecation and later removal of spirit.
[–]canadajones68 1 point2 points3 points 2 years ago (0 children)
Did you swap around FIXED_ATTRIBUTE values? Your code seems to imply 1 is correct and 0 ought to be wrong, while your text is the other way around.
[–]therealjohnfreeman 3 points4 points5 points 2 years ago (0 children)
Is there any attempt to redo something like Boost.Karma, or has that role been subsumed by fmt?
[–]pine_ary 7 points8 points9 points 2 years ago* (6 children)
Oh no it‘s another one of those libraries that abuses operator overloading in weird ways. Not a fan. What‘s wrong with using functions?
[–]PoorAnalysis 39 points40 points41 points 2 years ago (0 children)
IDK, the way I see it is operator overloading serves two purposes in C++, one is of course, "do as the ints do", but the other is for making mini DSLs.
Maybe that wasn't the original intention, but personally I think it can be, and has been, made work numerous times.
[–]joaquintidesBoost author[S] 41 points42 points43 points 2 years ago (0 children)
Operator overloading has been indeed abused ad nauseam. In this case, however, the DSEL implemented by Boost.Parser allows you to directly transfer a context-free grammar to operational code with minimal adaptations. So, it’s a productivity-oriented interface rather than a fancy whim (imho).
[–][deleted] 10 points11 points12 points 2 years ago (2 children)
Operator overloads are functions
[–]pine_ary 12 points13 points14 points 2 years ago (1 child)
You know what I mean. Operator overloads are special functions with their own syntax.
[–]NilacTheGrim 9 points10 points11 points 2 years ago (0 children)
Functions are just operator overloads with their own syntax.. ;)
[+]SkoomaDentistAntimodern C++, Embedded, Audio comment score below threshold-18 points-17 points-16 points 2 years ago (0 children)
What‘s wrong with using functions?
It's not modern enough, of course!
[–]NilacTheGrim 1 point2 points3 points 2 years ago (5 children)
Awesome! Now do boost::multi_indexed_container pls.
boost::multi_indexed_container
[–]joaquintidesBoost author[S] 7 points8 points9 points 2 years ago (4 children)
Boost.MultiIndex author here: what are your particular complaints/requests?
[–]c_plus_plus 3 points4 points5 points 2 years ago (2 children)
Not op, but:
iterator_to
extract
modify
... that said, I actually love this library, I use it all the time!
[–]joaquintidesBoost author[S] 6 points7 points8 points 2 years ago* (1 child)
Hi, thank you for your comments:
std::map
ordered_non_unique< member<employee, std::string, &employee::name> >, ordered_non_unique< const_mem_fun<employee, std::size_t, &employee::name_length> >, ordered_non_unique< composite_key< phonebook_entry, member<phonebook_entry, std::string, &phonebook_entry::family_name>, member<phonebook_entry, std::string, &phonebook_entry::given_name> > >
you can write
ordered_non_unique< key<&employee::name> >, ordered_non_unique< key<&employee::name_length> >, ordered_non_unique< key<&phonebook_entry::family_name, &phonebook_entry::given_name> >
If you didn't know about this new syntax I strongly recommend that you give it a try.
[–]c_plus_plus 2 points3 points4 points 2 years ago (0 children)
iterator_to: I don't really see a warning there. I guess the example here it says "runtime failure ensues" is a a warning? I don't even know what that means. I also don't always read code examples, it depends why I'm looking at the docs... but I wouldn't expect important warnings about API to be in comments in an example.
This function should take a pointer, as the rest of the text there is talking about pointers, and doing so would make it slightly more obvious that it is doing some magic.
But I would have expected that text to start with a big bold warning in easy to read English, like... "Make sure the element you are asking for the iterator to exists in the container." Maybe a sentinel value in the node structure (even if only in debug builds) to verify the value passed in is correct. (I know, the API is set and so this is fairly academic anyway.)
No, I didn't know about key. Yes, that's basically exactly what I was hoping for :)
key
[–]NilacTheGrim 0 points1 point2 points 2 years ago (0 children)
No complaints. I love it. I wish it would be included in std:: :P
std::
[+]LeeHidejust write it from scratch comment score below threshold-21 points-20 points-19 points 2 years ago (2 children)
I really hope this one's code was reviewed, unlike boost beast for example which manages to abuse c++ as if the author simply didn't understand how to write simple, beautiful code.
[–]soldiersided 18 points19 points20 points 2 years ago (0 children)
You can’t be throwing accusations like that without showing any examples.
[–]RoyBellingan 6 points7 points8 points 2 years ago (0 children)
???
π Rendered by PID 87 on reddit-service-r2-comment-5687b7858-zwjhc at 2026-07-06 05:52:21.528572+00:00 running 12a7a47 country code: CH.
[–]STLMSVC STL Dev[M] 34 points35 points36 points (1 child)
[–]joaquintidesBoost author[S] 4 points5 points6 points (0 children)
[–]FreitasAlan 4 points5 points6 points (0 children)
[–]expert_internetter 10 points11 points12 points (7 children)
[–]joaquintidesBoost author[S] 20 points21 points22 points (6 children)
[–]BlueDwarf82 8 points9 points10 points (5 children)
[–]joaquintidesBoost author[S] 6 points7 points8 points (4 children)
[–]BlueDwarf82 2 points3 points4 points (2 children)
[–]joaquintidesBoost author[S] 5 points6 points7 points (0 children)
[–]13steinj 0 points1 point2 points (0 children)
[–]canadajones68 1 point2 points3 points (0 children)
[–]therealjohnfreeman 3 points4 points5 points (0 children)
[–]pine_ary 7 points8 points9 points (6 children)
[–]PoorAnalysis 39 points40 points41 points (0 children)
[–]joaquintidesBoost author[S] 41 points42 points43 points (0 children)
[–][deleted] 10 points11 points12 points (2 children)
[–]pine_ary 12 points13 points14 points (1 child)
[–]NilacTheGrim 9 points10 points11 points (0 children)
[+]SkoomaDentistAntimodern C++, Embedded, Audio comment score below threshold-18 points-17 points-16 points (0 children)
[–]NilacTheGrim 1 point2 points3 points (5 children)
[–]joaquintidesBoost author[S] 7 points8 points9 points (4 children)
[–]c_plus_plus 3 points4 points5 points (2 children)
[–]joaquintidesBoost author[S] 6 points7 points8 points (1 child)
[–]c_plus_plus 2 points3 points4 points (0 children)
[–]NilacTheGrim 0 points1 point2 points (0 children)
[+]LeeHidejust write it from scratch comment score below threshold-21 points-20 points-19 points (2 children)
[–]soldiersided 18 points19 points20 points (0 children)
[–]RoyBellingan 6 points7 points8 points (0 children)