Click here to Skip to main content
15,895,011 members
Articles / Programming Languages / C++

Celero - Easy Benchmark Charts for your C++ Algorithms

Rate me:
Please Sign up or sign in to vote.
4.93/5 (11 votes)
7 Nov 2013Apache5 min read 26.9K   1.9K   32  
Discover how Celero makes benchmarking C++ code easy.
#ifndef _CELERO_PIMPL_H_
#define _CELERO_PIMPL_H_
 
#include <memory>
 
namespace celero
{
	///
	/// \class Pimpl
	///
	///	\author	Herb Sutter
	///	\author	John Farrier
	///
	/// Classes using this must overload the assignment operator.
	/// Original code by Herb Sutter.  Adapted for more primitive compilers by John Farrier.
	///
	template<typename T> class Pimpl 
	{
		public:
			Pimpl();
			//template<typename ...Args> Pimpl( Args&& ... );
			template<typename Arg1> Pimpl(Arg1&&);
			template<typename Arg1, typename Arg2> Pimpl(Arg1&&, Arg2&&);
			template<typename Arg1, typename Arg2, typename Arg3> Pimpl(Arg1&&, Arg2&&, Arg3&&);
			template<typename Arg1, typename Arg2, typename Arg3, typename Arg4> Pimpl(Arg1&&, Arg2&&, Arg3&&, Arg4&&);
			template<typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5> Pimpl(Arg1&&, Arg2&&, Arg3&&, Arg4&&, Arg5&&);
			template<typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6> Pimpl(Arg1&&, Arg2&&, Arg3&&, Arg4&&, Arg5&&, Arg6&&);
			~Pimpl();

			T* operator->();
			const T* const operator->() const;
			T& operator*();

		private:
			std::unique_ptr<T> _pimpl;
	};
}

#endif

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 Apache License, Version 2.0


Written By
Team Leader
United States United States
John Farrier is a professional C++ software engineer that specializes in modeling, simulation, and architecture development.

Specialties:

LVC Modeling & Simulation
Software Engineering, C++11, C++98, C, C#, FORTRAN, Python
Software Performance Optimization
Software Requirements Development
Technical Project and Team Leadership

Comments and Discussions