This post has been de-listed (Author was flagged for spam)
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
EDIT3: It's not std::unordered_map
that's changed, it's std::pair
. I suspect it's this commit that made this sort of incomplete container possible (yay concepts!), but would love for someone who speaks stdlib to confirm.
Original Post:
This compiles on GCC trunk:
#include <unordered_map>
struct Incomplete;
std::unordered_map<int, Incomplete> map;
struct Incomplete {};
int main() {};
Was this an intentional change or just a collateral bonus? It makes implementing certain types of recursive types convenient, and it's been true (though obviously not standards conforming) for std::map
for awhile. Just wondering if there was some impetus for this change.
EDIT: To be clear, this is only supported on trunk. I'm not literally asking "since when?" I'm asking "How? And why now?"
EDIT2: This supported on clang trunk (and only clang trunk) as well, though that makes sense since it's probably a libstdc change not a compiler one.
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/cpp/comment...