c++ - disallow access outside of file -
now know going static or anon namespace without reading let me no not i'm looking for. looking allow me kind of "quarantine" off file in code base can't access outside of file if changes it can't inadvertently screw things elsewhere. possible?
what looking allow me kind of "quarantine" off file in code base can't access outside of file if changes it can't inadvertently screw things elsewhere. possible?
for part, no, not part of c++ language.
in order accomplish goal, consider one/some of following:
- moving code file library reduce likelihood of collateral damage
- providing "guarantees" testing dynamic tools
valgrind
, purify, asan ("address sanitizer"), electric fence - making comments regarding intended design of code file ("isolated", "encapsulated", etc)
- build-time restrictions: dump preprocessed output source file, flagging cases new
#include
s (ones outside of whitelist, e.g.) show up.
Comments
Post a Comment