Closed schaumb closed 10 months ago
I found another way to work "fake object" without requiring C++20 (template variable):
template<class T>
struct X {
const T value;
static const X<T> report_if_you_see_link_error_with_this_object; // this is not defined, only declared. equivalent with template varaible
};
template <class T>
constexpr const T& fake_object() noexcept {
return X<T>::report_if_you_see_link_error_with_this_object.value;
}
This is equivalent to prf::detail::unsafe_declval
without the nullptr dereference hack.
I created already the changes. Can I try to apply these modifications too?
What do you think @denzor200 ?
Looks very good!
Many thanks for the PR!
resolves #151