add PVIFBuilder abstraction

This commit is contained in:
Michael Davidsaver
2017-09-12 15:31:46 -05:00
parent 0a9d03baf0
commit 850d79dc62
10 changed files with 123 additions and 42 deletions

View File

@ -1,6 +1,8 @@
#ifndef HELPER_H
#define HELPER_H
#include <memory>
#if __cplusplus>=201103L
# define AUTO_VAL(NAME,VAL) auto NAME = VAL
# define AUTO_REF(NAME,VAL) auto& NAME = VAL
@ -13,4 +15,15 @@
# error Require C++11 or G++
#endif
namespace p2p {
#if __cplusplus>=201103L
template<typename T>
using auto_ptr = std::unique_ptr<T>;
#define PTRMOVE(AUTO) std::move(AUTO)
#else
using std::auto_ptr;
#define PTRMOVE(AUTO) (AUTO)
#endif
}
#endif // HELPER_H