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:
parent
b6d157311b
commit
3394839542
@ -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
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user