#if SOME_PREPROCESSOR_JUNK
import foo;
#else
import bar;
#endif
This has legitimate use cases, say #ifdef WIN32
import mymodule.windows
#else
import mymodule.posix
#endif
So in reality build systems will be required to invoke at least the preprocessor to extract dependency information. template <int>
struct foo {
template <int>
static int bar(int);
};
template <>
struct foo<8> {
static const int bar = 99;
};
constexpr int some_function() { return (int) sizeof(void*); };
Now given the snippet foo<some_function()>::bar<0>(1);
then if some_function() returns something other than 8, we use the primary template and foo<N>::bar<0>(1) is a call to a static template member function.
No it isn't. https://godbolt.org/z/bz7EhMhMT