Turns out just because a function is only defined in a .cpp file, doesn't mean that it is private. E.g., I added
// flow.hpp
int namespace_experiment(int a) {
return a;
}
and then
// test_flow.cpp
int namespace_experiment(int a);
and that works just fine despite the declaration not being in the corresponding header, but rather an unrelated one.
But adding
// flow.hpp
namespace {
int namespace_experiment(int a) {
return a;
}
}
correctly makes it private.
We should fix this everywhere.
AI Generation Disclosure
I found this out when Claude used an anonymous namespace in #590 which prompted me to learn more about it.
Turns out just because a function is only defined in a
.cppfile, doesn't mean that it is private. E.g., I addedand then
and that works just fine despite the declaration not being in the corresponding header, but rather an unrelated one.
But adding
correctly makes it private.
We should fix this everywhere.
AI Generation Disclosure
I found this out when Claude used an anonymous namespace in #590 which prompted me to learn more about it.