Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / CommonTypes.h
blob: d85a10bc8476de980931f2ef3708414dcae78fbb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <string>
#include <vector>
#include <unordered_map>
#include <memory>
#include <stack>
#include <cassert>

template<typename T>
using IPLVector = std::vector<T>;
using IPLString = std::string;

template<typename T, typename K>
using IPLPair = std::pair<T, K>;

template <typename T>
using IPLStack = std::stack<T>;

template <typename Key, typename T>
using IPLUnorderedMap = std::unordered_map<Key, T>;

template <typename T>
using IPLSharedPtr = std::shared_ptr<T>;

template <typename T, class... Args>
inline IPLSharedPtr<T> IPLMakeSharePtr(Args&&... args) {
	return std::make_shared<T, Args...>(args...);
};

template< typename T>
using IPLEnableShared = std::enable_shared_from_this<T>;

struct IPLError
{
	unsigned Row;
	unsigned Column;
	IPLString File;
	IPLString What;
};

#define NOT_IMPLEMENTED assert(0 && "not-implemented")