Welcome to mirror list, hosted at ThFree Co, Russian Federation.

unique_ptr.hpp « std - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 536fa2523051d7f0e828b2315bbb51119371ce75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#ifdef new
#undef new
#endif

#include <memory>
using std::unique_ptr;

/// @todo(y): replace this hand-written helper function by
/// std::make_unique when it will be available in C++14
template <typename T, typename... Args>
unique_ptr<T> make_unique(Args &&... args)
{
  return unique_ptr<T>(new T(std::forward<Args>(args)...));
}

#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif