Re: (off-topic) RE: [Doxygen-users] Documenting IDL
Brought to you by:
dimitri
From: Hendrik S. <Do...@HS...> - 2001-06-12 20:03:03
|
"Victor A. Wagner, Jr." <va...@ru...> wrote: > or use void* like I ORIGINALLY suggested (and is suggested by looking at > how the STL does it with iterators. It's easy to confuse this with a pointer to the object taken care of by the smart pointer. > [...] > >The "the mythical 'logical' type that 'if', 'while' etc use" is not 'bool' - I > >suppose you could produce a parser that used bool there, but just taking a > >straw > >poll around the office, the guy sitting next to me (working on a C compiler) > >uses 'long int' for 'if' etc, which is what the Standard says you do > >(hence the > >use of operator int() to feed 'if' in the oldest code). Meanwhile, in my > [...] I'm not so sure about that. But I always thought, since the standard it's 'bool' for C++. (The guy next to you is working on a C compiler, after all. ;^> ) > > > template<class T> > > > class SmartPtr { > > > private: > > > class Tester { > > > void operator delete(void*); > > > }; > > > public: > > > operator Tester*() const > > > { > > > if( !IsValid() ) > > > return NULL; > > > static Tester tester; > > > return tester; > > > } > > > // ... > > > }; > [...] > >Aha, yet another approach :-) > > > >The suggestions - _all_ of them - all have their merits and all can all work > >extremely well, but, just like the search the One True String Class, there > >is no > >absolute best answer to this. Shame really. > [...] So what's the drawback of this one? Schobi |