2016-03-29 14:26:49 +00:00
|
|
|
/*
|
|
|
|
PURPOSE: (Test if item is an STL)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CHECKPOINT_IS_STL_CONTAINER
|
|
|
|
#define CHECKPOINT_IS_STL_CONTAINER
|
|
|
|
|
2017-09-27 21:01:52 +00:00
|
|
|
#include <array>
|
2016-03-29 14:26:49 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <list>
|
|
|
|
#include <deque>
|
|
|
|
#include <set>
|
2016-03-30 21:57:45 +00:00
|
|
|
#include <map>
|
2016-03-31 14:22:45 +00:00
|
|
|
#include <queue>
|
2016-03-31 15:32:13 +00:00
|
|
|
#include <stack>
|
2016-03-30 21:57:45 +00:00
|
|
|
#include <utility>
|
2016-03-29 14:26:49 +00:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct is_stl_container {
|
|
|
|
static const bool value = false;
|
|
|
|
};
|
|
|
|
|
2017-09-27 21:01:52 +00:00
|
|
|
template <typename T,std::size_t N>
|
|
|
|
struct is_stl_container<std::array<T,N> > {
|
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
2016-03-31 19:50:27 +00:00
|
|
|
template <typename T,typename _Alloc>
|
|
|
|
struct is_stl_container<std::vector<T,_Alloc> > {
|
2016-03-29 14:26:49 +00:00
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
2016-03-31 19:50:27 +00:00
|
|
|
template <typename T,typename _Alloc>
|
|
|
|
struct is_stl_container<std::list<T,_Alloc> > {
|
2016-03-29 14:26:49 +00:00
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
2016-03-31 19:50:27 +00:00
|
|
|
template <typename T,typename _Alloc>
|
|
|
|
struct is_stl_container<std::deque<T,_Alloc> > {
|
2016-03-29 14:26:49 +00:00
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
2016-03-31 19:50:27 +00:00
|
|
|
template <typename T,typename _Compare,typename _Alloc>
|
|
|
|
struct is_stl_container<std::set<T,_Compare,_Alloc> > {
|
2016-03-29 14:26:49 +00:00
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
2016-03-31 19:50:27 +00:00
|
|
|
template <typename T,typename _Compare,typename _Alloc>
|
|
|
|
struct is_stl_container<std::multiset<T,_Compare,_Alloc> > {
|
2016-03-29 14:26:49 +00:00
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
2016-03-30 21:57:45 +00:00
|
|
|
template <typename _Key, typename _Tp , typename _Compare, typename _Alloc>
|
|
|
|
struct is_stl_container<std::map<_Key,_Tp ,_Compare,_Alloc> > {
|
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename _Key, typename _Tp , typename _Compare, typename _Alloc>
|
|
|
|
struct is_stl_container<std::multimap<_Key,_Tp ,_Compare,_Alloc> > {
|
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename _T1,typename _T2>
|
|
|
|
struct is_stl_container<std::pair<_T1,_T2> > {
|
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
2016-03-31 14:22:45 +00:00
|
|
|
template <typename _Tp, typename _Sequence>
|
|
|
|
struct is_stl_container<std::queue<_Tp,_Sequence> > {
|
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
2016-03-31 15:32:13 +00:00
|
|
|
template <typename _Tp, typename _Container, typename _Compare>
|
|
|
|
struct is_stl_container<std::priority_queue<_Tp,_Container,_Compare> > {
|
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename _Tp, typename _Sequence>
|
|
|
|
struct is_stl_container<std::stack<_Tp,_Sequence> > {
|
2016-03-31 14:22:45 +00:00
|
|
|
static const bool value = true;
|
|
|
|
};
|
|
|
|
|
2016-03-29 14:26:49 +00:00
|
|
|
#endif
|
|
|
|
|