For example, suppose I have a template class foo in foo.h like below:
template <typename T>
struct foo {
constexpr static auto value = false;
};
in first.cpp file, I use the foo like below:
#include "foo.h"
auto dummy1() {
return foo<int>::value;
}
in second.cpp file, I write partial specialization for foo and use foo like below:
#include "foo.h"
template <std::integral T>
struct foo<T> {
constexpr static auto value = true;
};
auto dummy2() {
return foo<int>::value;
}
It's such program a well defined behavior in c++? What if dummy2 use unsigned int like below:
auto dummy2() {
return foo<unsigned int>::value;
}