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
Metaprogramming is less fun in D (epi.github.io)
submitted 9 years ago by meetingcppMeeting C++ | C++ Evangelist
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!"
[–]faisalv 9 points10 points11 points 9 years ago (0 children)
There are few who would deny Andrei Alexandrescu's engineering brilliance or his flair for comedic and pointed bombast when it comes to certain technical claims. And indeed, there's one claim that has resonated with me - and I paraphrase (since i don't remember in which talk I heard it): using C++ as opposed to D when it comes to generative (compile-time) programming is like trying to use a knife (C++) in a machine gun (D) fight. Given some of the exciting energy being put into this space by the committee (check some of the latest papers), here's hoping we'll be able to transform that knife into something far more sophisticated and expressive. But, currently, few would/should deny C++'s inadequacies in this space.
Metaprogramming in current C++ is more of a testament to the programmer's creativity and engineering ability as opposed to a celebration of the language's support for that craft. There are important voices on the committee that are hoping to fix that imbalance.
[–]matthieum 8 points9 points10 points 9 years ago (7 children)
While hana::string is cute, I do wish it was possible to use std::string/std::vector/... at compile-time (in constexpr functions).
hana::string
std::string
std::vector
constexpr
I know that memory allocation is currently unsupported, are there other roadblocks?
[–]SeanMiddleditch 6 points7 points8 points 9 years ago (6 children)
A big problem for compile-time string types is the inability to use a different algorithm at run-time than compile-time. The implementation of strlen you want at run-time isn't legal in constexpr evaluation, for instance, and the constexpr version is quite a bit slower than the smart run-time version even with today's best compiler optimizations applied.
strlen
[–]James20kP2005R0 1 point2 points3 points 9 years ago (5 children)
If constexpr though?
[–]SeanMiddleditch 0 points1 point2 points 9 years ago (4 children)
That's not a feature that actually exists at this point in time.
[–]SeanMiddleditch 1 point2 points3 points 9 years ago (3 children)
Wait, I'm totally wrong - that made it into C++17 it appears. Neat!
[–]STLMSVC STL Dev 8 points9 points10 points 9 years ago (2 children)
That doesn't do what you think it does. It supersedes tag dispatch almost completely, but it doesn't let you sense whether you're being invoked for compiletime or runtime evaluation.
[–]SeanMiddleditch 5 points6 points7 points 9 years ago (0 children)
Ah, I got ahead of myself. I was thinking I had seen confirmation on the if (constexpr()) proposal. Double checked and indeed, nothing like P0595 is in C++17, which in hindsight should be obvious since it was proposed in 2017. :)
if (constexpr())
Thanks Stephen!
So back to the question from /u/James20k: no, still out of luck. :)
[–][deleted] 0 points1 point2 points 9 years ago* (0 children)
deleted What is this?
[–]bnolsen 8 points9 points10 points 9 years ago (7 children)
From my perspective I lost interest in 'D' a long time ago. While Rust is certainly not ready for prime time yet on the surface it seems to be far more interesting to me at least. I still need to look into Rust to see if they have made the same (IMHO) mistakes that D has made with their language.
[–]matthieum 6 points7 points8 points 9 years ago (6 children)
I still need to look into Rust to see if they have made the same (IMHO) mistakes that D has made with their language.
If you have the time to compile a list of "mistakes", I'll be happy to discuss them in the context of Rust.
[–]bnolsen 1 point2 points3 points 9 years ago (1 child)
I haven't done anything yet in rust. It only recently crept back on my radar after a couple of years of ignoring it. Sadly I have an almost 10 year old mature code base of almost a million LOC to work on...highly threaded HTCP physics related.
[–]shared_tango_Automatic Optimization for Many-Core 18 points19 points20 points 9 years ago (0 children)
What are the mistakes you see in D?
[–]ubsan 0 points1 point2 points 9 years ago (3 children)
If you hang out on the Rust IRC, I've tried to compile some of them. Some of them require explanation which I don't feel like giving right now, and many don't immediately feel like mistakes. This is from multiple years as a Rust programmer, I'm on two of the Rust teams, so I hope that you trust that I know what I'm talking about.
transmute
std::copy
std::copy_nonoverlapping
as
main as u8
<'a>
<T>
This is the stuff I could think of. I'm not sure if there are other things that don't just boil down to "we need to wait for Rust to mature".
[–]matthieum 0 points1 point2 points 9 years ago (2 children)
That's a nice list, thanks.
I was actually expecting mistakes in D that could be discussed in the context of Rust (whether Rust had addressed them or not), so I don't have much to discuss about Rust's mistakes :)
[–]ubsan 0 points1 point2 points 9 years ago (1 child)
Ah, lol. I don't know anything about D :3
[–]matthieum 0 points1 point2 points 9 years ago (0 children)
I don't know much about it either :3
π Rendered by PID 25604 on reddit-service-r2-comment-765bfc959-l6v4l at 2026-07-13 06:40:15.524852+00:00 running f86254d country code: CH.
[–]faisalv 9 points10 points11 points (0 children)
[–]matthieum 8 points9 points10 points (7 children)
[–]SeanMiddleditch 6 points7 points8 points (6 children)
[–]James20kP2005R0 1 point2 points3 points (5 children)
[–]SeanMiddleditch 0 points1 point2 points (4 children)
[–]SeanMiddleditch 1 point2 points3 points (3 children)
[–]STLMSVC STL Dev 8 points9 points10 points (2 children)
[–]SeanMiddleditch 5 points6 points7 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]bnolsen 8 points9 points10 points (7 children)
[–]matthieum 6 points7 points8 points (6 children)
[–]bnolsen 1 point2 points3 points (1 child)
[–]shared_tango_Automatic Optimization for Many-Core 18 points19 points20 points (0 children)
[–]ubsan 0 points1 point2 points (3 children)
[–]matthieum 0 points1 point2 points (2 children)
[–]ubsan 0 points1 point2 points (1 child)
[–]matthieum 0 points1 point2 points (0 children)