C++ Logo


Advanced search

Can we limit dependencies in a modularized std library

From: Peter Sommerlad (C++) <"Peter>
Date: Thu, 11 Nov 2021 10:44:00 +0100

import std;

will make everything available in the std namespace. However, there are
some features in the standard library that should not be used naïvely or
by novices.

Today, we limit the #include <iostream> to the TU that implements main()
as a means to prevent untestable functions relying on mutable globals

Will we have to rely on importing header modules instead of import std;
to get such a behavior of limiting dependencies?

Or would we have to use static analysis tooling to prevent the use of
undesirable features, which we now easily could grep for the
corresponding header #include?


Peter Sommerlad
Better Software: Consulting, Training, Reviews
Modern, Safe & Agile C++
+41 79 432 23 32

Received on 2021-11-11 03:44:06