r/cpp • u/According_Leopard_80 • Apr 09 '26
Writing only decoupled code
https://middleraster.github.io/DAG/HeaderOnlyNoForwardDeclarations.html
12
Upvotes
r/cpp • u/According_Leopard_80 • Apr 09 '26
View all comments
14
u/garnet420 Apr 09 '26
This is just not right. You can create this sort of problem without having any cycles easily.
If I had to point at any aspect of the dependency graph as being correlated to it, I would maybe say "total number of edges" or "edges that reach through multiple layers" or something like that.
And prohibiting forward declaration is just a dumb thing Google says to do, and people repeat it because Google said it and they're... Big?