A goal of never allocating storage appears to be a goal of defining a
name for a value so that the compiler can inline use of that value
instead of referring to a memory location where the value is stored.
In modern C++ this can be expressed with `constexpr`.
`constexpr` can't handle e.g. a `std::string`, because it uses dynamic
allocation which necessarily is done at run-time, while the `constexpr`
mechanism is entirely compile time.
> 2. 'const definitions must default to internal linkage' 'linker errors
> would occur with complicated consts because they cause storage to be
> allocated in multiple cpp files. The linker would see the same
> definition in multiple object files, and complain'
>
> How? It's only a definition when a value is assigned. Therefore if C++
> did default to external storage, ONLY WHEN I DID:
>
> const int i = 10;
> would there be conflict IF it was used in multiple files (.c)
>
> If i just did:
> const int i;
> and C++ defaults to external storage this would be great because I
> wouldn't need 'extern' and it would automagically link to whichever file
> had the definition.
You can't do the latter, it won't compile.
But I'm not sure what Bruce is talking about here, I think I'd have to
look that up in context to get some traction on it.
Possibly relevant: Monthy Python's sketch about Bruce the Australian.
<url:
https://www.youtube.com/watch?v=bNBy1D1Y0h4>
Cheers!,
- Alf