TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25763 2
Self Contained Source Groups are amazing

I basically adopted this idea from Abseil ([https://abseil.io/](https://abseil.io/)) and from this CppCon talk: [https://youtu.be/re4Oy1IVj-s?si=3bwtKqOyMAX6WSAs](https://youtu.be/re4Oy1IVj-s?si=3bwtKqOyMAX6WSAs).

I structure each source group in my projects like this:

src_grp/
├── iface/
│ └── smth.cppm
├── impl/
│ └── smth.cpp
├── inc_pub/
│ └── pub.hpp
├── inc_priv/
│ ├── priv.hpp
│ └── maybe.inc
├── test/
│ └── test.cpp
├── bench/
│ └── bench.cpp
└── docs/
├── some.md
└── doxygen.in

I strongly recommend this approach over older project-wide conventions such as having a single global `test/` or `bench/` directory etc.

https://redd.it/1wlcn2k
@r_cpp
abseil.io abseil / abseil.io An open-source collection of core C++ library code
More from @r_cpp
  1. Oct 5, 2026C++ Salary expectations Mods: Please note that I am not looking for jobs or trying to brea…
  2. Oct 5, 2026Embedded C++ Just curious how useful the ability to embed C++ as a scripting language into…
  3. Oct 5, 2026Good Active Open Source Projects Looking For Contributions Hi. I'm wondering if someone wi…
  4. Oct 5, 2026index based for vs for-each https://godbolt.org/z/zh4Kf87M8 https://redd.it/1wksz8y @r_cpp
  5. Oct 5, 2026The Address is Not The Place: Object Residency in C++26 - Laurie Kirk - CppCon 2026 https:…
  6. Oct 5, 2026std::call_once vs. std::async https://devblogs.microsoft.com/oldnewthing/20260917-00/?p=11…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →