Translating parts of WTL to D

Lionello Lunesu lio at lunesu.remove.com
Thu May 18 06:33:12 PDT 2006


Try 2:

#struct _U_MENUorID {
#  static _U_MENUorID opCall(HMENU hMenu) {
#    _U_MENUorID u;
#    u.m_hMenu = hMenu;
#    return u;
#  }
#  static _U_MENUorID opCall(UINT nID) {
#    _U_MENUorID u;
#    u.m_hMenu = cast(HMENU)nID;
#    return u;
#  }
#  HMENU m_hMenu;
#}
#void testfunc( _U_MENUorID x = _U_MENUorID(null) ){}

It'll be efficient (no new's, pass by val) but needs an explicit cast 
(for both the default value and every passed parameter).

L.



More information about the Digitalmars-d-learn mailing list