Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 1287

Answer by HolyBlackCat for Can the semantics of a translation unit depend on a function declaration that is never used?

$
0
0

I see at least two ways that unused functions can affect behavior:

  • They can instantiate templates:

    • ...that can have static variables with constructors with side effects.
    • ...that can perform stateful metaprogramming to affect other code (instantiated class defines a friend function, then other template checks for its existence).
  • Certain kinds of UB can cause unused functions can get called in practice.


Viewing all articles
Browse latest Browse all 1287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>