Need trait of isPod.

Aarti_pl aarti at interia.pl
Tue Oct 9 05:27:50 PDT 2007


Yang Bo pisze:
> Because I really want to know whether a type is pod.

Simple template should be just enough.

See: http://dsource.org/projects/tango/browser/trunk/tango/core/Variant.d


template isAtomicType( T ) {
	static if( is( T == bool )
 		|| is( T == char )
 	        || is( T == wchar )
 	        || is( T == dchar )
 	        || is( T == byte )
 	        || is( T == short )
 	        || is( T == int )
 	        || is( T == long )
 	        || is( T == ubyte )
 	        || is( T == ushort )
 	        || is( T == uint )
 	        || is( T == ulong )
 	        || is( T == float )
 	        || is( T == double )
 	        || is( T == real )
 	        || is( T == ifloat )
 	        || is( T == idouble )
 	        || is( T == ireal ) )
 		const isAtomicType = true;
	else
 	        const isAtomicType = false;
}

BR
Marcin Kuszczak
(aarti_pl)



More information about the Digitalmars-d mailing list