Physical design

Code-level7 standards

Headers, ODR, inline variables, modules.

Header discipline: include guards, forward declarations to cut coupling, inline functions in headers, extern templates to curb duplicate instantiation. ODR violations are the silent killer.

// widget.h
class Renderer;              // forward-declare, don't include
class Widget {
  Renderer* r_;              // pointer: declaration is enough
};

No change; constexpr functions being implicitly inline keeps header-only utilities ODR-safe.

inline variables end the extern-constant dance: one definition across all TUs, declared where it is used.

// config.h — complete, no .cpp needed
inline constexpr std::string_view app_name = "stbd";

Modules replace textual inclusion: real encapsulation (non-exported names stay private), no macro leakage, order-independent imports — the biggest compilation-model change since C.

export module geometry;
export struct Point { double x, y; };
double norm(Point);            // not exported: invisible to importers

import std; — the entire standard library as one module (P2465), dramatically cheaper than any include set and usable even in otherwise header-based builds.

import std;
int main() { std::println("hello"); }

Adoption era: build systems (CMake's import std, module scanning) catch up, and #embed moves binary assets out of hand-converted headers. Guidance: new code modularizes top-down, headers remain the interop surface.

C++29direction · not adopted

Direction: module-aware tooling, package-ecosystem integration, and the long tail of making modules the default rather than the exception.

C++26 per the final working draft; C++29 rows are proposals and direction, not adopted features.