Galois
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExtraTraits.h
Go to the documentation of this file.
1 /*
2  * This file belongs to the Galois project, a C++ library for exploiting
3  * parallelism. The code is being released under the terms of the 3-Clause BSD
4  * License (a copy is located in LICENSE.txt at the top-level directory).
5  *
6  * Copyright (C) 2018, The University of Texas at Austin. All rights reserved.
7  * UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING THIS
8  * SOFTWARE AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF MERCHANTABILITY,
9  * FITNESS FOR ANY PARTICULAR PURPOSE, NON-INFRINGEMENT AND WARRANTIES OF
10  * PERFORMANCE, AND ANY WARRANTY THAT MIGHT OTHERWISE ARISE FROM COURSE OF
11  * DEALING OR USAGE OF TRADE. NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH
12  * RESPECT TO THE USE OF THE SOFTWARE OR DOCUMENTATION. Under no circumstances
13  * shall University be liable for incidental, special, indirect, direct or
14  * consequential damages or loss of profits, interruption of business, or
15  * related expenses which may arise from use of Software or Documentation,
16  * including but not limited to those resulting from defects in Software and/or
17  * Documentation, or loss or inaccuracy of data of any kind.
18  */
19 
26 #ifndef GALOIS_RUNTIME_EXTRA_TRAITS_H
27 #define GALOIS_RUNTIME_EXTRA_TRAITS_H
28 
29 #include <type_traits>
30 #include <boost/mpl/has_xxx.hpp>
31 
32 // depending on compiler version, trivially copyable defintion changes
33 #if __GNUC__ < 5
34 #define __is_trivially_copyable(type) __has_trivial_copy(type)
36 #else
37 #define __is_trivially_copyable(type) std::is_trivially_copyable<type>::value
39 #endif
40 
41 namespace galois {
42 namespace runtime {
43 
44 BOOST_MPL_HAS_XXX_TRAIT_DEF(tt_has_serialize)
46 template <typename T>
47 struct has_serialize : public has_tt_has_serialize<T> {};
48 
49 BOOST_MPL_HAS_XXX_TRAIT_DEF(tt_is_copyable)
51 template <typename T>
52 struct is_copyable : public has_tt_is_copyable<T> {};
53 
55 template <typename T>
60 };
61 
63 template <typename T>
67 };
68 
69 } // namespace runtime
70 } // namespace galois
71 
72 #endif
Indicates if T is serializable.
Definition: ExtraTraits.h:56
Indicates if T has the serialize trait.
Definition: ExtraTraits.h:47
static const bool value
true if T is serializable
Definition: ExtraTraits.h:58
#define __is_trivially_copyable(type)
Defines what it means to be trivially copyable.
Definition: ExtraTraits.h:35
static const bool value
true if T is memory copyable
Definition: ExtraTraits.h:66
Indicates if T is trivially copyable.
Definition: ExtraTraits.h:52
Indicates if T is memory copyable.
Definition: ExtraTraits.h:64