C++ choose overloaded constructor for a stack object by condition -
i want this:
if (customlocation.isempty()) { kurl url; } else { kurl url(customlocation); } /* use url */
any reason can't do
kurl url; if (!customlocation.isempty()) { url = kurl(customlocation); } /* use url */ or
kurl url = customlocation.isempty() ? kurl() : kurl(customlocation);
Comments
Post a Comment