RSS Forums RSS
Please support our C++ advertiser: Programming Forums
Views: 2334 | Replies: 11 | Thread Tools  Display Modes
Reply
Join Date: Jul 2005
Location: London
Posts: 164
Reputation: Stoned_coder is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
Stoned_coder Stoned_coder is offline Offline
Junior Poster

Re: substitute of sizeof operator

  #11  
Sep 7th, 2005
not my solution. I would have used an addressof() func written like so....
template<typename T>
T* addressof(T& val)
{
   return reinterpret_cast<T*>(&const_cast<char&>(reinterpret_cast<const volatile char&>(val)));
}
and would have used that.
Kinda a cheat to use the array name to miss the overloaded & operator.
Reply With Quote  
Join Date: Jul 2005
Location: London
Posts: 164
Reputation: Stoned_coder is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
Stoned_coder Stoned_coder is offline Offline
Junior Poster

Re: substitute of sizeof operator

  #12  
Sep 7th, 2005
now how do you simulate sizeof for a singleton? cant put those in arrays, as by definition only 1 will exist.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Other Threads in the C++ Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 7:59 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC