Sane API design (AKA C's #ifdef hell)

Adam D. Ruppe destructionator at gmail.com
Fri Apr 17 13:51:58 UTC 2026


On Friday, 17 April 2026 at 10:32:37 UTC, Dennis wrote:
> The effort needed to accommodate "complex library" and "all 
> versions" by far eclipses the effort to write a little 
> boilerplate like:

Substitution static if for version opens the door for more order 
of eval bugs in the compiler. I've never been able to actually do 
it in a real world project.

tbh though instead of versioning symbols i'd rather they be like 
marked... better to say "function foo was introduced in version 
4.4 but you are using 4.3 compatibility flags" rather than 
"undefined symbol: foo"


More information about the Digitalmars-d mailing list