1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-21 20:27:13 +01:00

Use standard type trait instead of legacy solution.

This commit is contained in:
Sandu Liviu Catalin 2018-10-31 20:11:15 +02:00
parent b6d157311b
commit 3394839542

View File

@ -46,20 +46,8 @@ namespace Sqrat {
/// utility taken from http://stackoverflow.com/questions/2733377/is-there-a-way-to-test-whether-a-c-class-has-a-default-constructor-other-than/2770326#2770326
/// may be obsolete in C++ 11
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template< class T >
class is_default_constructible {
template<int x>
class receive_size{};
template< class T > using is_default_constructible = std::is_default_constructible<T>;
template< class U >
static int sfinae( receive_size< sizeof U() > * );
template< class U >
static char sfinae( ... );
public:
enum { value = sizeof( sfinae<T>(0) ) == sizeof(int) };
};
/// @endcond
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////