Re: [Dev-C++] Re: Design decision in C++
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Doug M. <dou...@al...> - 2004-03-11 15:59:01
|
Per and Kevin, Thanks for your advice. My ambivalence wrt the Singleton<DataType> class is in part due to the instance pointer offset hack, which seems to introduce a risk of implementation dependency: are base and derived classes always included in a standard order with offsets that never vary from compiler to compiler?. Further, the instance pointer adjustment involves pointer <-> int casts that are a bit ugly, despite the elegance of Singleton as seen from the outside. But I take your points as to the limited desirability of fully static classes. (I guess declaring a top-level static _instance_ of a class is a different matter, and is useful, e.g., when there is no C++ main routine, as was the case in a former project of mine at my last employer.) --Doug |