VisionCpp  0.0.1
type_dereferencer.hpp
Go to the documentation of this file.
1 // This file is part of VisionCpp, a lightweight C++ template library
2 // for computer vision and image processing.
3 //
4 // Copyright (C) 2016 Codeplay Software Limited. All Rights Reserved.
5 //
6 // Contact: visioncpp@codeplay.com
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 // http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 
20 /// \file type_dereferencer.hpp
21 /// \brief These methods are used to remove all the & const and * from a type.
22 
23 #ifndef VISIONCPP_INCLUDE_FRAMEWORK_TOOLS_TYPE_DEREFERENCER_HPP_
24 #define VISIONCPP_INCLUDE_FRAMEWORK_TOOLS_TYPE_DEREFERENCER_HPP_
25 
26 namespace visioncpp {
27 namespace internal {
28 namespace tools {
29 /// \struct RemoveAll
30 /// \brief These methods are used to remove all the & const and * from a type.
31 /// template parameters
32 /// \tparam T : the type we are interested in
33 template <typename T>
34 struct RemoveAll {
35  typedef T Type;
36 };
37 /// specialisation of RemoveAll when the type contains &
38 template <typename T>
39 struct RemoveAll<T &> {
40  typedef typename RemoveAll<T>::Type Type;
41 };
42 /// specialisation of RemoveAll when the type contains *
43 template <typename T>
44 struct RemoveAll<T *> {
45  typedef typename RemoveAll<T>::Type Type;
46 };
47 /// specialisation of RemoveAll when the type contains const
48 template <typename T>
49 struct RemoveAll<const T> {
50  typedef typename RemoveAll<T>::Type Type;
51 };
52 
53 /// specialisation of RemoveAll when the type contains const and &
54 template <typename T>
55 struct RemoveAll<const T &> {
56  typedef typename RemoveAll<T>::Type Type;
57 };
58 /// specialisation of RemoveAll when the type contains volatile
59 template <typename T>
60 struct RemoveAll<T volatile> {
61  typedef typename RemoveAll<T>::Type Type;
62 };
63 /// specialisation of RemoveAll when the type contains const volatile
64 template <typename T>
65 struct RemoveAll<T const volatile> {
66  typedef typename RemoveAll<T>::Type Type;
67 };
68 /// specialisation of RemoveAll when the type contains const and *
69 template <typename T>
70 struct RemoveAll<const T *> {
71  typedef typename RemoveAll<T>::Type Type;
72 };
73 } // tools
74 } // internal
75 } // visioncpp
76 #endif // VISIONCPP_INCLUDE_FRAMEWORK_TOOLS_TYPE_DEREFERENCER_HPP_
VisionCpp namespace.
Definition: sycl/device.hpp:24
These methods are used to remove all the & const and * from a type.