2022-02-11 13:53:21 +01:00
|
|
|
/* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
* Copyright 2011-2022 Blender Foundation */
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
|
#ifndef __UTIL_MAP_H__
|
|
|
|
|
#define __UTIL_MAP_H__
|
|
|
|
|
|
|
|
|
|
#include <map>
|
2018-07-25 16:59:46 +02:00
|
|
|
#include <unordered_map>
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
|
|
using std::map;
|
|
|
|
|
using std::pair;
|
2015-03-29 22:12:22 +02:00
|
|
|
using std::unordered_map;
|
2019-08-14 01:53:09 -04:00
|
|
|
using std::unordered_multimap;
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2019-05-03 11:23:16 +02:00
|
|
|
template<typename T> static void map_free_memory(T &data)
|
|
|
|
|
{
|
|
|
|
|
/* Use swap() trick to actually free all internal memory. */
|
|
|
|
|
T empty_data;
|
|
|
|
|
data.swap(empty_data);
|
|
|
|
|
}
|
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
CCL_NAMESPACE_END
|
|
|
|
|
|
|
|
|
|
#endif /* __UTIL_MAP_H__ */
|