Files
safe_numerics/example/example93.cpp
Robert Ramey dea5a291b1 Added “inline” to all free standing functions. This is in response to an issue whereby including the same types in a library ends up producing multiple copies of the function. This only shows up when combinations of types are reused. This should fix the problem. BUT I can’t figure out a way to really test it. These changes pass all tests - but there is no “linking” test to show this specific problem.
Actually this raises the question about what a “header only” library really is.  When it gets included in multiple modules, it looks like the compiler/linker consolidates functions with the same type signature - thus conflicting with most persons idea of what “header only” should actually mean.  Food for thought.

It also raises the issue of “head only” libraries and “code bloat”.  By making sure everything is inline we are contributing to code bloat.  This really should/could be addressed with making “inline”  INLINE and defining it according to what kind output we want to produce (ie. executable, static library, shared library, etc.).  But of course that changes the API - another can of worms.
2020-12-15 11:04:31 -08:00

8.5 KiB