Skip to content
Snippets Groups Projects
Forked from ogs / ogs
23795 commits behind the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Counter.h 620 B
/**
 * \copyright
 * Copyright (c) 2012-2014, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#ifndef BASELIB_GLOBALCOUNTER_H
#define BASELIB_GLOBALCOUNTER_H

#include <cstddef>

namespace BaseLib
{
template <typename X>
struct Counter
{
	Counter()
	{
		_counter_value++;
	}
	static std::size_t _counter_value;
};

template <typename X> std::size_t Counter<X>::_counter_value(0);

} // end namespace BaseLib

#endif  // BASELIB_GLOBALCOUNTER_H