|
|
Choosing A Webhost: |
Re: ObjectPtrT::operator-> const problem: msg#00009apache.logging.log4cxx.user
On Nov 7, 2007 5:10 PM, Curt Arnold <carnold@xxxxxxxxxx> wrote:
Actually, I think there is a simpler solution. Here's what I tried: =================================================================== --- src/main/include/log4cxx/helpers/objectptr.h (revision 593214) +++ src/main/include/log4cxx/helpers/objectptr.h (working copy) @@ -137,8 +137,7 @@ bool operator!=(const ObjectPtrT& p1) const { return (this->p != p1.p); } bool operator==(const T* p1) const { return (this->p == p1); } bool operator!=(const T* p1) const { return (this->p != p1); } - T* operator->() {return (T*) p; } - const T* operator->() const {return (const T*) p; } + T* operator->() const {return (T*) p; } T& operator*() const {return (T&) *p; } operator T*() const {return (T*) p; } Note that the single version of operator-> that I added can be used anywhere that either of the previous versions could be used, as well as in the test case I originally described. I tried this with msvc8. The trunk (593214) builds fine, as do the unit tests. The unit tests run as well as they did before. There is a crash midway through, but it crashes in the same place without any local changes. Naturally, all of my code is also fine with this change.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Compiling SVN revision 592828, Renato Fernandes Cantão |
|---|---|
| Next by Date: | Re: ObjectPtrT::operator-> const problem, Curt Arnold |
| Previous by Thread: | Re: ObjectPtrT::operator-> const problem, Curt Arnold |
| Next by Thread: | Re: ObjectPtrT::operator-> const problem, Curt Arnold |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |