File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -421,10 +421,18 @@ namespace classdesc
421421 // general, XML does not support polymorphism, so this won't really
422422 // work anyway.
423423 template <class T >
424- void xsd_generate (xsd_generate_t & g, const string& d, const shared_ptr<T>& a)
424+ typename enable_if<Not<is_default_constructible<T> >, void >::T
425+ xsd_generate (xsd_generate_t & g, const string& d, const shared_ptr<T>& a)
425426 {
426- xsd_generate_t ::Optional o (g,true );
427- xsd_generate (g,d,*a);
427+ xsd_generate_t ::Optional o (g,true );
428+ if (a) xsd_generate (g,d,*a);
429+ }
430+ template <class T >
431+ typename enable_if<is_default_constructible<T>, void >::T
432+ xsd_generate (xsd_generate_t & g, const string& d, const shared_ptr<T>& a)
433+ {
434+ xsd_generate_t ::Optional o (g,true );
435+ xsd_generate (g,d,T ());
428436 }
429437
430438 template <class T >
You can’t perform that action at this time.
0 commit comments