D - throw - catch
- "Matthew Wilson" <matthew stlsoft.org> Oct 10 2003
- J Anderson <anderson badmama.com.au.REMOVE> Oct 14 2003
Any reason why we can't borrow some nice parts from a couple of other
languages, and allow the following
Enumerator Enumerate()
{
hrecls_t hSrch;
recls_rc_t rc = Search_Create(m_searchRoot, m_pattern,
m_flags, hSrch);
try
{
return new Enumerator(hSrch, rc);
}
catch
{
Search_Close(hSrch);
throw;
}
}
which would translate to
Enumerator Enumerate()
{
hrecls_t hSrch;
recls_rc_t rc = Search_Create(m_searchRoot, m_pattern,
m_flags, hSrch);
try
{
return new Enumerator(hSrch, rc);
}
catch(Exception x)
{
Search_Close(hSrch);
throw x;
}
}
It's a nice sugar.
Oct 10 2003
Matthew Wilson wrote:Any reason why we can't borrow some nice parts from a couple of other languages, and allow the following Enumerator Enumerate() { hrecls_t hSrch; recls_rc_t rc = Search_Create(m_searchRoot, m_pattern, m_flags, hSrch); try { return new Enumerator(hSrch, rc); } catch { Search_Close(hSrch); throw; } } which would translate to Enumerator Enumerate() { hrecls_t hSrch; recls_rc_t rc = Search_Create(m_searchRoot, m_pattern, m_flags, hSrch); try { return new Enumerator(hSrch, rc); } catch(Exception x) { Search_Close(hSrch); throw x; } } It's a nice sugar.
-Anderson
Oct 14 2003








J Anderson <anderson badmama.com.au.REMOVE>