Click here to Skip to main content
15,868,016 members
Articles / Programming Languages / C++

Clone Smart Pointer (clone_ptr)

Rate me:
Please Sign up or sign in to vote.
4.89/5 (13 votes)
20 Jul 2021CPOL4 min read 76.4K   751   19  
A smart pointer which acts like a reference variable
The Clone Smart Pointer class is a smart pointer which acts as a reference variable for comparison and copy operations. When sorted in STL containers (std::map, vector, list, and deque), the container gets sorted based on the object pointed to, and NOT by the pointer address.

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Commvault
United States United States
I started programming as a hobby in 1985 on my 8-bit Atari computer. I programmed in BASIC and in assembly language until I upgraded to a 16-bit IBM compatible in 1988.
In 1989, I started programming in C using Turbo C++. IMHO, Turbo C/C++ was the best compiler available to the market for many years, until VC++ 4.0 came out.
I started using MFC with VC++ 4.0 in 1996, and I developed and sold an application called GameMenu95. It had limited success, and I retired the program in 1999.

I now perform contract work in a variety of operating systems mostly using C/C++.
I occasionally have contract work for Java applications and MS Access development.

My favorite language of choice is C++. I believe it has the best combination of flexibility, speed, and type safety.
I’ve used many compilers and IDE, to include (VC++7.0, 7.1, 6.0, GCC 2.x, 3.x, Turbo C/C++, Borland 5.x, Watcom, MinGW, DevC++, Eclipse….)
However, by far, my most favorite IDE is VC++6.0. Although this compiler has poor C++ compliance, it more then makes up for it by its outstanding interface and tools.

Coding is still my hobby, and I’m very fortunate in that I get paid good money to engage in my hobby!

Life is good!!! Smile | :)


If I really helped you save some bucks, I would like to ask you for something: Please donate some of these saved bucks (you decide) to the charity organization of your choice - or just help out somebody who is needier than you are......
Pass it on....... Smile | :)

Comments and Discussions