mCRL2
Loading...
Searching...
No Matches
type_traits_impl.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink. Based on the aterm library by Paul Klint and others.
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
11
12#ifndef ATERMPP_DETAIL_TYPE_TRAITS_H
13#define ATERMPP_DETAIL_TYPE_TRAITS_H
14
15#include <type_traits>
16#include <set>
17#include <vector>
18#include <list>
19
20namespace atermpp
21{
22
23namespace detail
24{
25
26// Condition for recognising types that represent containers
27template < typename T >
28struct is_container_impl : public std::false_type
29{ };
30
31template < typename T >
32struct is_container_impl<std::list<T> > : public std::true_type
33{ };
34
35template < typename T >
36struct is_container_impl< std::set< T > > : public std::true_type
37{ };
38
39template < typename T >
40struct is_container_impl< std::multiset< T > > : public std::true_type
41{ };
42
43template < typename T >
44struct is_container_impl< std::vector< T > > : public std::true_type
45{ };
46
47template < bool C, typename Container, typename Value >
48struct lazy_check_value_type : public std::false_type
49{ };
50
51template < typename Container, typename ValueType >
52struct lazy_check_value_type< true, Container, ValueType > : public
53 std::is_convertible< typename Container::value_type, ValueType >
54{ };
55
56template < typename T >
57struct is_set_impl : public std::false_type
58 { };
59
60template < typename T >
61struct is_set_impl< std::set< T > > : public std::true_type
62 { };
63
64template < typename T >
65struct is_set_impl< std::multiset< T > > :public std::true_type
66 { };
67
68} // namespace detail
69
70} // namespace atermpp
71
72#endif // ATERMPP_DETAIL_TYPE_TRAITS_H
73
A vector class in which aterms can be stored.
Definition vector.h:34
The main namespace for the aterm++ library.
Definition algorithm.h:21
STL namespace.