Incase it doesn’t show up:

  • xthexder
    link
    fedilink
    arrow-up
    3
    ·
    14 days ago

    It really depends what you’re doing. The last big project I did with C++ templates was using them to make a lot of compile-time guarantees about concurrency locks so they don’t need to be checked at runtime (thus trading my development time for faster performance). I was able to hide the majority of the templates from users of the library, and spent extra time writing custom static_assert messages.

    C++ templates are in fact a compile-time turing complete language, as crazy as that sounds.