2017-05-29 17:21:11 +10:00
|
|
|
/*
|
2018-08-04 15:14:06 +10:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2017-05-29 17:21:11 +10:00
|
|
|
*
|
|
|
|
* Copyright 2017 Danny Robson <danny@nerdcruft.net>
|
|
|
|
*/
|
|
|
|
|
2017-11-22 16:49:37 +11:00
|
|
|
#include "typeidx.hpp"
|
2017-05-29 17:21:11 +10:00
|
|
|
|
2018-04-05 12:14:11 +10:00
|
|
|
#include <atomic>
|
2017-05-29 17:21:11 +10:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2018-04-05 12:14:11 +10:00
|
|
|
int
|
2018-08-05 14:42:02 +10:00
|
|
|
cruft::detail::typeidx_next ()
|
2017-05-29 17:21:11 +10:00
|
|
|
{
|
2018-04-05 12:14:11 +10:00
|
|
|
static std::atomic<int> counter = 0;
|
2017-05-29 17:21:11 +10:00
|
|
|
return counter++;
|
|
|
|
}
|