home.social

#enddefer — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #enddefer, aggregated by home.social.

  1. @amdg2 aha, right, good point about conditional includes! And the same defer mechanism would be just as useful for undefining macros. So, I imagine something like this:

    // in stdlib.h

    #define __cplusplus
    #include <algorithm>

    #defer
    #undef __cplusplus
    #uninclude <algorithm>
    #enddefer

    static inline void qsort(whatever) {
    // Efficient implementation using std::sort
    }

  2. @amdg2 cursed! The uninclude would happen at the end of the header file it's in, right?

    Also I don't think the preprocessor ever uses the double hash sign syntax, how about this?

    #defer
    #uninclude <foo>
    #enddefer