[type_traits] check for default constructor?

27 Feb
2008
27 Feb
'08
5:06 p.m.
Hello Boosters, how can I detect the presence of a default constructor in a certain class? Using the VC8 compiler, I tried several things but with limited success: has_trivial_constructor<T> only recognizes automatically created constructors, but not explicitely declared ones. has_nothrow_constructor<T> is too restrictive as it requires a throw() declaration. is_convertible<void, T> did not work either. Any ideas or pointers? Am I missing something? Yours, -- Dr. Martin Schulz (schulz@synopsys.com) Senior R&D Engineer Synopsys GmbH Karl-Hammerschmidt-Str. 34 D-85609 Dornach, Germany Munich office: +49 (89) 993-20203 Home office: +49 (721) 6099511 http://www.synopsys.com
6313
Age (days ago)
6313
Last active (days ago)
0 comments
1 participants
participants (1)
-
Martin Schulz