Click here to Skip to main content
15,885,801 members
Articles / Programming Languages / C++

The fastest smart pointer in the west

Rate me:
Please Sign up or sign in to vote.
4.56/5 (18 votes)
7 Oct 200313 min read 111.7K   1.6K   41  
Need a super quick implementation of a reference counting smart pointer? AUTO_REF delivers just that, with a 'thin' source code of just 3,886 bytes (< 4KB)
#ifndef _SETUPH_LOADED_
#define _SETUPH_LOADED_




//
//PTR_SWITCH values:       40 - A: use AUTO_REF   
//                         50 - B: use C pointers (MY_CLASS *)
//                         60 - C: use RefCountPtr
//                         70 - D: use idllib::SmartPtr
//                         80 - E: use boost::shared_ptr
//                         90 - F: use GE::Safe::PtrStrong

#define PTR_SWITCH 40


//Uncomment the next line to turn verbose mode on
//#define VERBOSE


   
#ifdef _DEBUG
#  ifndef VERBOSE
#	   define VERBOSE
#  endif
#endif



#endif //_SETUPH_LOADED_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions