Simply, will the following assert ever fire?
template<typename T>
auto destructor()
{
return +[](void* p){
((T*)p)->~T();
};
}
assert(destructor<int>() != destructor<char>());
The standard only seems to say that the lambda converted function pointer does the same thing as the lambda itself, then you realize trivially destructed types all have no-op destructors and are therefore identical.